Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entity: Fix death behavior of 0 #1319

Merged
merged 1 commit into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading