avoid an unneccessary and frequent trait lookup
This commit is contained in:
@@ -235,8 +235,7 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
// Wait a bit to see if they leave
|
// Wait a bit to see if they leave
|
||||||
if (!hasWaited)
|
if (!hasWaited)
|
||||||
{
|
{
|
||||||
var info = self.Info.Traits.Get<MobileInfo>();
|
waitTicksRemaining = mobile.Info.WaitAverage + self.World.SharedRandom.Next(-mobile.Info.WaitSpread, mobile.Info.WaitSpread);
|
||||||
waitTicksRemaining = info.WaitAverage + self.World.SharedRandom.Next(-info.WaitSpread, info.WaitSpread);
|
|
||||||
hasWaited = true;
|
hasWaited = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user