forked from 0ad/0ad
Don't send PositionChanged messages in TurnTo when not actually turning
FaceTowardsTarget is called quite often by UnitAI, and we can skip some un-necessary messages as an optimisation. Differential Revision: https://code.wildfiregames.com/D5005 This was SVN commit r27695.
This commit is contained in:
parent
44611294de
commit
080599442f
@ -556,6 +556,10 @@ public:
|
||||
if (cmpPosition)
|
||||
y -= cmpPosition->GetRotation().Y;
|
||||
}
|
||||
// Don't send messages if we don't actually rotate.
|
||||
if ((y - m_RotY).Absolute() <= fixed::Epsilon())
|
||||
return;
|
||||
|
||||
m_RotY = y;
|
||||
|
||||
AdvertisePositionChanges();
|
||||
|
Loading…
Reference in New Issue
Block a user