Fixed #8782
This commit is contained in:
@@ -1956,6 +1956,9 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
case health -> {
|
||||
health = (float)Mathf.clamp(value, 0, maxHealth);
|
||||
healthChanged();
|
||||
if(health <= 0f && !dead()){
|
||||
Call.buildDestroyed(self());
|
||||
}
|
||||
}
|
||||
case team -> {
|
||||
Team team = Team.get((int)value);
|
||||
|
||||
@@ -261,7 +261,12 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
@Override
|
||||
public void setProp(LAccess prop, double value){
|
||||
switch(prop){
|
||||
case health -> health = (float)Mathf.clamp(value, 0, maxHealth);
|
||||
case health -> {
|
||||
health = (float)Mathf.clamp(value, 0, maxHealth);
|
||||
if(health <= 0f && !dead){
|
||||
kill();
|
||||
}
|
||||
}
|
||||
case x -> x = World.unconv((float)value);
|
||||
case y -> y = World.unconv((float)value);
|
||||
case rotation -> rotation = (float)value;
|
||||
|
||||
@@ -189,7 +189,7 @@ public class GameService{
|
||||
}
|
||||
});
|
||||
|
||||
Events.on(BlockBuildBeginEvent.class, e -> {
|
||||
Events.on(BlockBuildEndEvent.class, e -> {
|
||||
if(campaign() && state.rules.sector == SectorPresets.groundZero.sector && e.tile.block() == Blocks.coreNucleus){
|
||||
nucleusGroundZero.complete();
|
||||
}
|
||||
|
||||
@@ -359,8 +359,14 @@ public class CoreBlock extends StorageBlock{
|
||||
|
||||
@Override
|
||||
public void changeTeam(Team next){
|
||||
if(this.team == next) return;
|
||||
|
||||
state.teams.unregisterCore(this);
|
||||
|
||||
super.changeTeam(next);
|
||||
|
||||
state.teams.registerCore(this);
|
||||
|
||||
Events.fire(new CoreChangeEvent(this));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user