mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-05-17 21:32:34 +08:00
Fix some revives; improve dungeon exit flow (#2409)
This commit is contained in:
committed by
GitHub
Unverified
parent
837e30e04b
commit
f86259a430
@@ -174,13 +174,7 @@ public abstract class GameEntity {
|
||||
}
|
||||
|
||||
this.lastAttackType = attackType;
|
||||
|
||||
// Check if dead
|
||||
if (this.getFightProperty(FightProperty.FIGHT_PROP_CUR_HP) <= 0f) {
|
||||
this.setFightProperty(FightProperty.FIGHT_PROP_CUR_HP, 0f);
|
||||
this.isDead = true;
|
||||
}
|
||||
|
||||
this.checkIfDead();
|
||||
this.runLuaCallbacks(event);
|
||||
|
||||
// Packets
|
||||
@@ -194,6 +188,17 @@ public abstract class GameEntity {
|
||||
}
|
||||
}
|
||||
|
||||
public void checkIfDead() {
|
||||
if (this.getFightProperties() == null || !hasFightProperty(FightProperty.FIGHT_PROP_CUR_HP)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.getFightProperty(FightProperty.FIGHT_PROP_CUR_HP) <= 0f) {
|
||||
this.setFightProperty(FightProperty.FIGHT_PROP_CUR_HP, 0f);
|
||||
this.isDead = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the Lua callbacks for {@link EntityDamageEvent}.
|
||||
*
|
||||
@@ -333,6 +338,8 @@ public abstract class GameEntity {
|
||||
if (entityController != null) {
|
||||
entityController.onDie(this, getLastAttackType());
|
||||
}
|
||||
|
||||
this.isDead = true;
|
||||
}
|
||||
|
||||
/** Invoked when a global ability value is updated. */
|
||||
|
||||
Reference in New Issue
Block a user