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:
David Markowitz
2025-11-16 14:17:26 -08:00
committed by GitHub
parent 5410acffaa
commit 991e55f305
7 changed files with 90 additions and 31 deletions

View File

@@ -215,6 +215,10 @@ public:
*/
int GetActivityID() { return m_ActivityInfo.ActivityID; }
// Whether or not team loot should be dropped on death for this activity
// if true, and a player is supposed to get loot, they are skipped
bool GetNoTeamLootOnDeath() const { return m_ActivityInfo.noTeamLootOnDeath; }
/**
* Returns if this activity has a lobby, e.g. if it needs to instance players to some other map
* @return true if this activity has a lobby, false otherwise

View File

@@ -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;
}

View File

@@ -472,6 +472,7 @@ public:
bool OnGetObjectReportInfo(GameMessages::GameMsg& msg);
bool OnSetFaction(GameMessages::GameMsg& msg);
bool OnIsDead(GameMessages::GameMsg& msg);
void SetIsDead(const bool value) { m_IsDead = value; }