Allow the attached animations to be retained and hidden when the unit disappears (f.ex. cloak, enters a vehicle)#1969
Conversation
|
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
|
There is already per-animation control for this ( |
| DEFINE_HOOK(0x425174, AnimClass_PointerExpired_KeepAnimOnLimbo, 0x6) | ||
| { | ||
| if (!RulesExt::Global()->KeepAnimOnLimbo) | ||
| return 0; | ||
|
|
||
| GET_STACK(bool, bRemoved, STACK_OFFSET(0xC, 0x8)); | ||
| return bRemoved ? 0 : 0x4251A3; | ||
| } |
There was a problem hiding this comment.
Also I am fairly certain that what this is doing is blanket preventing deletion of the animation if its parent object is being detached for any reason whatsoever, which seems like it might cause unwanted side effects somewhere.
There was a problem hiding this comment.
Yeah it is.
Actually, I can't understand why WW would remove all the animations attached to it just because the unit disappeared. I think it should actually be hidden rather than removed.
There was a problem hiding this comment.
My main concern is that it may skip cases where the removal is warranted e.g destruction as well. But I assume the bRemoved check might take care of that if it is being used correctly.
There was a problem hiding this comment.
What do you think are the reasons for removing the animation when the unit disappears? What are the use cases?
There was a problem hiding this comment.
If by 'disappear' you mean limbo then there's probably no good reason to delete it vs. hiding since most cases for limboing are temporary anyway. As long as it is deleted if the parent object disappears permanently it should be fine. Overlap with DetachOnCloak should be resolved still, though.
There was a problem hiding this comment.
My main concern is that it may skip cases where the removal is warranted e.g destruction as well. But I assume the bRemoved check might take care of that if it is being used correctly.
I'm actually also worried whether it might cause some problems. But so far, I haven't encountered any during my tests.
|
TODO: deal with |
[General] -> KeepAnimOnLimbo=true.