Dominated siege creeps use the death animation from their original and not current team

Here's a partial dump of two siege creep packet entities from a replay http://pastebin.com/YcBmRPqK Note there are properties for that entity and inherited properties from its base class.

The properties I think are relevant here are CBodyComponentBaseAnimatingOverlay.m_hModel and m_iTeamNum. We can see that both entities inherit property CBodyComponentBaseAnimatingOverlay.m_hModel with value 10631518217970662349 and property m_iTeamNum with value 2. However, the second entity overrides the values for these two properties with CBodyComponentBaseAnimatingOverlay.m_hModel 10574014672836916167 and m_iTeamNum 3.

Now for my speculation on what is happening. I believe each model just has a set of animations associated with it. So you have a radiant siege creep model with all its animations and you have one for the dire version. Both are managed by some model class like CBodyComponentBaseAnimatingOverlay where as seen in the entity dump each entity has a CBodyComponentBaseAnimatingOverlay instance which has a property m_hModel Now looking at the workshop tools wiki I see there's a section called CBodyComponent. Not exactly the same, but I think the function SetAnimation and its description "Pass string for the animation to play on this model" gives us some insight into how death animation is tied to this. I imagine the different animations are just tied to the model. So if an entity had one particular model attached to it, if you told it to play its death animation, then it would play whatever death animation that model has.

So really what I think is happening is that at some point the entire model for the siege creep is being switched from the dire one to the radiant one right before the death animation is played.

Now you suggested in another comment a function that does that

Catapult::die() { model = loadModel(isDire() ? "Dire_catapult" : "Radiant_catapult"); model->playAnimation("Death"); }

You said that wouldn't make much sense, and I agree. However the line "model = loadModel(isDire() ? "Dire_catapult" : "Radiant_catapult");" doesn't need to take place right there in that function. I believe the model associated with the entity is just switched elsewhere prior to death taking place.

I believe that when the entity is killed, before the actual death animation is played, some sort of "OnDeath" event is triggered. The dominated buff/debuff/dominated flag or however it is implemented is removed on the "OnDeath" event which then changes the model for the entity back to its original owner team's model. Then the actual entity is killed and its model death animation played.

/r/DotA2 Thread Parent Link - i.imgur.com