Fix all wandering actors wandering at first game tick

NotifyBecomingIdle is only notified at the first idle tick, so `countdown` is not set when TickIdle checks it at first game tick. Therefore, we let TickIdle return early at first game tick to avoid that.
This commit is contained in:
reaperrr
2016-06-24 16:35:21 +02:00
parent c2d4a3a8e8
commit 4eb17e1642

View File

@@ -39,6 +39,7 @@ namespace OpenRA.Mods.Common.Traits
int countdown;
int ticksIdle;
int effectiveMoveRadius;
bool firstTick = true;
public Wanders(Actor self, WandersInfo info)
{
@@ -54,6 +55,13 @@ namespace OpenRA.Mods.Common.Traits
public void TickIdle(Actor self)
{
// The countdown has not have been set at this point, so don't check yet
if (firstTick)
{
firstTick = false;
return;
}
if (--countdown > 0)
return;