Cleared unit timeouts on reset
This commit is contained in:
@@ -14,6 +14,7 @@ import mindustry.core.*;
|
||||
import mindustry.ctype.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.game.EventType.*;
|
||||
import mindustry.game.MapObjectives.*;
|
||||
import mindustry.game.Teams.*;
|
||||
import mindustry.gen.*;
|
||||
@@ -64,6 +65,10 @@ public class LExecutor{
|
||||
//yes, this is a minor memory leak, but it's probably not significant enough to matter
|
||||
protected static IntFloatMap unitTimeouts = new IntFloatMap();
|
||||
|
||||
static{
|
||||
Events.on(ResetEvent.class, e -> unitTimeouts.clear());
|
||||
}
|
||||
|
||||
boolean timeoutDone(Unit unit, float delay){
|
||||
return Time.time >= unitTimeouts.get(unit.id) + delay;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user