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;
|
||||
|
||||
Reference in New Issue
Block a user