Skip to content

Commit 289770c

Browse files
Simplify dead HP preservation to explicit zero (#665)
Stat rebuild via AddBase/AddTotal restores Current to Total, but a dead player must stay at 0 HP until revived. Set HP explicitly to 0 instead of preserving the previous value. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 88b710c commit 289770c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Maple2.Server.Game/Manager/StatsManager.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ public void Refresh() {
140140
AddBuffs(player);
141141
Values.Total();
142142
StatConversion(player);
143+
144+
// Stat rebuild via AddBase/AddTotal restores Current to Total,
145+
// but a dead player must stay at 0 HP until revived.
146+
if (player.IsDead) {
147+
Values[BasicAttribute.Health].Current = 0;
148+
}
149+
143150
Actor.Field.Broadcast(StatsPacket.Init(player));
144151
Actor.Field.Broadcast(StatsPacket.Update(player), player.Session);
145152

0 commit comments

Comments
 (0)