Skip to content

Commit

Permalink
fix: death bug
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbeBryssinck committed Mar 12, 2022
1 parent 1f1b605 commit b4fab96
Show file tree
Hide file tree
Showing 4 changed files with 635 additions and 642 deletions.
4 changes: 4 additions & 0 deletions Code/client/Services/Generic/ActorValueService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,10 @@ void ActorValueService::OnHealthChangeBroadcast(const NotifyHealthChangeBroadcas

const float newHealth = pActor->GetActorValue(ActorValueInfo::kHealth) + acMessage.DeltaHealth;
pActor->ForceActorValue(2, ActorValueInfo::kHealth, newHealth);

const float health = pActor->GetActorValue(ActorValueInfo::kHealth);
if (health <= 0.f)
pActor->Kill();
}

void ActorValueService::OnActorValueChanges(const NotifyActorValueChanges& acMessage) const noexcept
Expand Down
Loading

0 comments on commit b4fab96

Please sign in to comment.