Many bugfixes / Support for repairing derelict in selection
This commit is contained in:
@@ -112,6 +112,10 @@ public class Units{
|
||||
return player == null || tile == null || tile.interactable(player.team()) || state.rules.editor;
|
||||
}
|
||||
|
||||
public static boolean isHittable(@Nullable Posc target, boolean air, boolean ground){
|
||||
return target != null && (target instanceof Buildingc ? ground : (target instanceof Unit u && u.checkTarget(air, ground)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates a target.
|
||||
* @param target The target to validate
|
||||
|
||||
@@ -90,6 +90,8 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc, Unitc{
|
||||
}
|
||||
|
||||
void pickup(Unit unit){
|
||||
if(unit.isAdded()) unit.team.data().updateCount(unit.type, 1);
|
||||
|
||||
unit.remove();
|
||||
addPayload(new UnitPayload(unit));
|
||||
Fx.unitPickup.at(unit);
|
||||
|
||||
Reference in New Issue
Block a user