Skip to content

Commit

Permalink
Entity: Fix death behavior of 0
Browse files Browse the repository at this point in the history
  • Loading branch information
EmosewaMC committed Nov 25, 2023
1 parent 8a15906 commit 044a50a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dGame/Entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1503,7 +1503,7 @@ void Entity::Smash(const LWOOBJID source, const eKillType killType, const std::u
destroyableComponent->Smash(source, killType, deathType);
}

void Entity::Kill(Entity* murderer) {
void Entity::Kill(Entity* murderer, const eKillType killType) {
if (!m_PlayerIsReadyForUpdates) return;

for (const auto& cb : m_DieCallbacks) {
Expand All @@ -1527,7 +1527,7 @@ void Entity::Kill(Entity* murderer) {
bool waitForDeathAnimation = false;

if (destroyableComponent) {
waitForDeathAnimation = destroyableComponent->GetDeathBehavior() == 0;
waitForDeathAnimation = destroyableComponent->GetDeathBehavior() == 0 && killType != eKillType::SILENT;
}

// Live waited a hard coded 12 seconds for death animations of type 0 before networking destruction!
Expand Down
2 changes: 1 addition & 1 deletion dGame/Entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class Entity {
void RequestActivityExit(Entity* sender, LWOOBJID player, bool canceled);

void Smash(const LWOOBJID source = LWOOBJID_EMPTY, const eKillType killType = eKillType::VIOLENT, const std::u16string& deathType = u"");
void Kill(Entity* murderer = nullptr);
void Kill(Entity* murderer = nullptr, const eKillType killType = eKillType::SILENT);
void AddRebuildCompleteCallback(const std::function<void(Entity* user)>& callback) const;
void AddCollisionPhantomCallback(const std::function<void(Entity* target)>& callback);
void AddDieCallback(const std::function<void()>& callback);
Expand Down
2 changes: 1 addition & 1 deletion dGame/dComponents/DestroyableComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ void DestroyableComponent::Smash(const LWOOBJID source, const eKillType killType
}
}

m_Parent->Kill(owner);
m_Parent->Kill(owner, killType);
}

void DestroyableComponent::SetFaction(int32_t factionID, bool ignoreChecks) {
Expand Down

0 comments on commit 044a50a

Please sign in to comment.