mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
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
1 changed files with 4 additions and 0 deletions
|
|
@ -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 a new issue