[DiscordArchive] leaving every map or just specific ones?
[DiscordArchive] leaving every map or just specific ones?
Archived author: MR.MUSTACHE • Posted: 2019-06-25T13:29:36.735000+00:00
Original source
leaving every map or just specific ones?
Archived author: MR.MUSTACHE • Posted: 2019-06-25T13:30:05.587000+00:00
Original source
for example I needed to handle Dungeon Leaving
Archived author: MR.MUSTACHE • Posted: 2019-06-25T13:30:09.828000+00:00
Original source
so I made it like this
estroyMapCreature(this);Archived author: MR.MUSTACHE • Posted: 2019-06-25T13:30:13.828000+00:00
Original source
```cpp
void Map::RemovePlayerFromMap(Player* player, bool remove)
{
// Before leaving map, update zone/area for stats
player->UpdateZone(MAP_INVALID_ZONE, 0);
sScriptMgr->OnPlayerLeaveMap(this, player);
if (IsDungeon() && CreatureMod::HasCreatureMods(this))
CreatureMod:
estroyMapCreature(this);
```