[Fix] Add trader/buyer cleanup actions (#4843)

* Add trader/buyer cleanup actions

Add trader/buyer db cleanup for
- on zone idle
- on client first login
- when world drops a zone connection
- in Client::ProcessMovePC

Cleanup several compiler warnings

* Formatting Updates
This commit is contained in:
Mitch Freeman
2025-05-14 22:24:59 -03:00
committed by GitHub
parent a2b28b2e16
commit 1221e88d92
10 changed files with 166 additions and 47 deletions
+12 -1
View File
@@ -681,9 +681,20 @@ void Client::MoveZoneInstanceRaid(uint16 instance_id, const glm::vec4 &location)
void Client::ProcessMovePC(uint32 zoneID, uint32 instance_id, float x, float y, float z, float heading, uint8 ignorerestrictions, ZoneMode zm)
{
// From what I have read, dragged corpses should stay with the player for Intra-zone summons etc, but we can implement that later.
// From what I have read, dragged corpses should stay with the player for Intra-zone summons etc, but we can
// implement that later.
ClearDraggedCorpses();
// Added to ensure that if a player is moved (ported, gmmove, etc) and they are an active trader or buyer, they will
// be removed from future transactions.
if (IsTrader()) {
TraderEndTrader();
}
if (IsBuyer()) {
ToggleBuyerMode(false);
}
if(zoneID == 0)
zoneID = zone->GetZoneID();