Skip to content

Commit

Permalink
Fix default target id for ListenerAlignTarget
Browse files Browse the repository at this point in the history
Fixes an editor freeze and runtime crash when user has a file with a ListenerAlignTarget with no align target set. In the runtime, the targetId would be set to 0 which would resolve to another component.

Verified the fix works in editor and viewer no longer crashes.

Diffs=
06f13b3d8 Fix default target id for ListenerAlignTarget (#8110)

Co-authored-by: Philip Chung <[email protected]>
  • Loading branch information
philter and philter committed Sep 10, 2024
1 parent 0cf0159 commit 1eae8b8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a4e15fb7b532b276e15b5d3b3a60843581641a05
06f13b3d8d8611738d9aaf031971714df83ed4a5
2 changes: 1 addition & 1 deletion dev/defs/animation/listener_align_target.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"type": "Id",
"typeRuntime": "uint",
"initialValue": "Core.missingId",
"initialValueRuntime": "0",
"initialValueRuntime": "-1",
"key": {
"int": 240,
"string": "targetid"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ListenerAlignTargetBase : public ListenerAction
static const uint16_t preserveOffsetPropertyKey = 541;

private:
uint32_t m_TargetId = 0;
uint32_t m_TargetId = -1;
bool m_PreserveOffset = false;

public:
Expand Down

0 comments on commit 1eae8b8

Please sign in to comment.