Don't configure processor when no changes are made
This commit is contained in:
@@ -136,7 +136,9 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc, Unitc{
|
||||
int rot = (int)((rotation + 45f) / 90f) % 4;
|
||||
payload.place(on, rot);
|
||||
|
||||
if(isPlayer()) payload.build.lastAccessed = getPlayer().name;
|
||||
if(getControllerName() != null){
|
||||
payload.build.lastAccessed = getControllerName();
|
||||
}
|
||||
|
||||
Fx.unitDrop.at(tile);
|
||||
Fx.placeBlock.at(on.drawx(), on.drawy(), on.block().size);
|
||||
|
||||
@@ -445,6 +445,15 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
remove();
|
||||
}
|
||||
|
||||
/** @return name of direct or indirect player controller. */
|
||||
@Override
|
||||
public @Nullable String getControllerName(){
|
||||
if(isPlayer()) return getPlayer().name;
|
||||
if(controller instanceof LogicAI ai && ai.controller != null) return ai.controller.lastAccessed;
|
||||
if(controller instanceof FormationAI ai && ai.leader != null && ai.leader.isPlayer()) return ai.leader.getPlayer().name;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void display(Table table){
|
||||
type.display(self(), table);
|
||||
|
||||
Reference in New Issue
Block a user