mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-25 15:07:28 +00:00
Entity: Fix death behavior of 0 (#1319)
This commit is contained in:
parent
0c32be01ba
commit
a1f8ab763d
@ -1509,7 +1509,7 @@ void Entity::Smash(const LWOOBJID source, const eKillType killType, const std::u
|
|||||||
destroyableComponent->Smash(source, killType, deathType);
|
destroyableComponent->Smash(source, killType, deathType);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Entity::Kill(Entity* murderer) {
|
void Entity::Kill(Entity* murderer, const eKillType killType) {
|
||||||
if (!m_PlayerIsReadyForUpdates) return;
|
if (!m_PlayerIsReadyForUpdates) return;
|
||||||
|
|
||||||
for (const auto& cb : m_DieCallbacks) {
|
for (const auto& cb : m_DieCallbacks) {
|
||||||
@ -1533,7 +1533,7 @@ void Entity::Kill(Entity* murderer) {
|
|||||||
bool waitForDeathAnimation = false;
|
bool waitForDeathAnimation = false;
|
||||||
|
|
||||||
if (destroyableComponent) {
|
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!
|
// Live waited a hard coded 12 seconds for death animations of type 0 before networking destruction!
|
||||||
|
@ -210,7 +210,7 @@ public:
|
|||||||
void RequestActivityExit(Entity* sender, LWOOBJID player, bool canceled);
|
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 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 AddRebuildCompleteCallback(const std::function<void(Entity* user)>& callback) const;
|
||||||
void AddCollisionPhantomCallback(const std::function<void(Entity* target)>& callback);
|
void AddCollisionPhantomCallback(const std::function<void(Entity* target)>& callback);
|
||||||
void AddDieCallback(const std::function<void()>& callback);
|
void AddDieCallback(const std::function<void()>& callback);
|
||||||
|
@ -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) {
|
void DestroyableComponent::SetFaction(int32_t factionID, bool ignoreChecks) {
|
||||||
|
Loading…
Reference in New Issue
Block a user