HomeWildfire Games

Fix units changing appearance when switching animation.

Description

Fix units changing appearance when switching animation.

Bug introduced in rP25210.
The previous CUnit code had logic to select random aesthetic variants once initially. The new code removed that, as I completely missed its purpose, assuming that the random selection, being based on a seed, would pick the same variants every time. This is incorrect because entity selections can change the RNG calls, thus the variants, and thus entity appearance can change when the animation changes (typically, a horse will change color when walking and running).

The solution is to re-introduce the choice of actor selections on CUnit creation. This makes sure that units don't change their purely-aesthetic selections when e.g. animations change.

Reported by: Wowgetoffyourcellphone

Tested By: Stan

Differential Revision: https://code.wildfiregames.com/D4205

Event Timeline

vladislavbelov added inline comments.
/ps/trunk/source/graphics/ObjectBase.cpp
789

There is a constant for that: MAX_QUALITY.

wraitii added inline comments.Jul 31 2021, 8:09 PM
/ps/trunk/source/graphics/ObjectBase.cpp
789

Right, should change here and in ObjectManager.cpp