mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-11-20 17:12:25 +00:00
feat: dont drop loot for dead players if configured in the zone activity settings (#1935)
* feat: dont drop loot for dead players if configured in the zone activity settings * fix errors Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dGame/dComponents/ActivityComponent.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dGame/dUtilities/Loot.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -88,6 +88,7 @@ DestroyableComponent::DestroyableComponent(Entity* parent, const int32_t compone
|
||||
|
||||
RegisterMsg<GetObjectReportInfo>(this, &DestroyableComponent::OnGetObjectReportInfo);
|
||||
RegisterMsg<GameMessages::SetFaction>(this, &DestroyableComponent::OnSetFaction);
|
||||
RegisterMsg<GameMessages::IsDead>(this, &DestroyableComponent::OnIsDead);
|
||||
}
|
||||
|
||||
DestroyableComponent::~DestroyableComponent() {
|
||||
@@ -1191,3 +1192,9 @@ bool DestroyableComponent::OnSetFaction(GameMessages::GameMsg& msg) {
|
||||
SetFaction(modifyFaction.factionID, modifyFaction.bIgnoreChecks);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DestroyableComponent::OnIsDead(GameMessages::GameMsg& msg) {
|
||||
auto& isDeadMsg = static_cast<GameMessages::IsDead&>(msg);
|
||||
isDeadMsg.bDead = m_IsDead || (GetHealth() == 0 && GetArmor() == 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user