Skip to content

Commit

Permalink
Merge pull request #5858 from TracentEden2/destroy_zone_wide_treasure…
Browse files Browse the repository at this point in the history
…_pool_empty_zone

[core] Clear zone wide treasure pool when last player leaves zone
  • Loading branch information
zach2good authored Jun 1, 2024
2 parents d3978dc + 33f66b0 commit 4ac8b60
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/map/zone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,14 @@ void CZone::CharZoneOut(CCharEntity* PChar)
PChar->PTreasurePool->DelMember(PChar);
}

// If zone-wide treasure pool but no players in zone then destroy current pool and create new pool
// this prevents loot from staying in zone pool after the last player leaves the zone
if (m_TreasurePool && m_TreasurePool->GetPoolType() == TREASUREPOOL_ZONE && m_zoneEntities->CharListEmpty())
{
destroy(m_TreasurePool);
m_TreasurePool = new CTreasurePool(TREASUREPOOL_ZONE);
}

PChar->ClearTrusts(); // trusts don't survive zone lines

if (PChar->isDead())
Expand Down

0 comments on commit 4ac8b60

Please sign in to comment.