Fixed infinite fire / Command center logic control
This commit is contained in:
@@ -20,6 +20,8 @@ import mindustry.world.*;
|
||||
import mindustry.world.meta.*;
|
||||
|
||||
public class CommandCenter extends Block{
|
||||
public final int timerEffect = timers ++;
|
||||
|
||||
public TextureRegionDrawable[] commandRegions = new TextureRegionDrawable[UnitCommand.all.length];
|
||||
public Color topColor = null, bottomColor = Color.valueOf("5e5e5e");
|
||||
public Effect effect = Fx.commandSend;
|
||||
@@ -33,11 +35,17 @@ public class CommandCenter extends Block{
|
||||
solid = true;
|
||||
configurable = true;
|
||||
drawDisabled = false;
|
||||
logicConfigurable = true;
|
||||
|
||||
config(UnitCommand.class, (CommandBuild build, UnitCommand command) -> {
|
||||
build.team.data().command = command;
|
||||
effect.at(build, effectSize);
|
||||
Events.fire(new CommandIssueEvent(build, command));
|
||||
if(build.team.data().command != command){
|
||||
build.team.data().command = command;
|
||||
//do not spam effect
|
||||
if(build.timer(timerEffect, 60f)){
|
||||
effect.at(build, effectSize);
|
||||
}
|
||||
Events.fire(new CommandIssueEvent(build, command));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -52,6 +60,11 @@ public class CommandCenter extends Block{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean configSenseable(){
|
||||
return true;
|
||||
}
|
||||
|
||||
public class CommandBuild extends Building{
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user