Skip to content

Commit f05652e

Browse files
committed
Change: Don't recreate an empty state for hidden animated objects
https://bveworldwide.forumotion.com/t2454-my-w-i-p-route-doesn-t-work-v-1-11-1-2#21973 Can't currently reproduce, this may help
1 parent 81ead22 commit f05652e

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

source/OpenBveApi/Objects/ObjectTypes/AnimatedObject/AnimatedObject.cs

+2-10
Original file line numberDiff line numberDiff line change
@@ -219,17 +219,9 @@ public void Initialize(int StateIndex, ObjectType Type, bool Show)
219219
{
220220
internalObject.Prototype = States[t].Prototype;
221221
}
222-
else
223-
{
224-
/*
225-
* Must internally reset the object, not create a new one.
226-
* This allows the reference to keep pointing to the same place
227-
*/
228-
internalObject.Prototype = new StaticObject(currentHost);
229-
}
230-
222+
231223
CurrentState = StateIndex;
232-
if (Show)
224+
if (Show && StateIndex != -1)
233225
{
234226
currentHost.ShowObject(internalObject, Type);
235227
}

0 commit comments

Comments
 (0)