Skip to content

Commit

Permalink
fix(skymp5-server): setting isDead to false via gamemode makes actor …
Browse files Browse the repository at this point in the history
…invulnerable (#1727)
  • Loading branch information
Pospelove authored Nov 1, 2023
1 parent c940354 commit db5ee49
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion skymp5-server/cpp/server_guest_lib/MpActor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,16 @@ void MpActor::SetRespawnTime(float time)

void MpActor::SetIsDead(bool isDead)
{
SendAndSetDeathState(isDead, false);
constexpr bool kShouldTeleport = false;

if (isDead) {
if (IsDead() == false) {
SendAndSetDeathState(isDead, kShouldTeleport);
}
} else {
// same as SendAndSetDeathState but resets isRespawning flag
Respawn(kShouldTeleport);
}
}

void MpActor::RestoreActorValue(espm::ActorValue av, float value)
Expand Down

0 comments on commit db5ee49

Please sign in to comment.