Core/Creatures: Updated totem slot assignment logic

* Implemented SUMMON_SLOT_ANY_TOTEM
* Fixed showing totems on player frames
* Fixed removing totems from player frames
* Fixed being able to summon unlimited windfury totems
This commit is contained in:
Shauren
2023-08-15 00:49:30 +02:00
parent 792f8041bb
commit fefc719263
6 changed files with 93 additions and 20 deletions

View File

@@ -38,7 +38,7 @@
#include "SpellAuraEffects.h"
#include "SpellMgr.h"
#include "SpellPackets.h"
#include "Totem.h"
#include "TemporarySummon.h"
#include "TotemPackets.h"
#include "World.h"
@@ -533,8 +533,8 @@ void WorldSession::HandleTotemDestroyed(WorldPackets::Totem::TotemDestroyed& tot
return;
Creature* totem = ObjectAccessor::GetCreature(*_player, _player->m_SummonSlot[slotId]);
if (totem && totem->IsTotem() && totem->GetGUID() == totemDestroyed.TotemGUID)
totem->ToTotem()->UnSummon();
if (totem && totem->IsTotem() && (totemDestroyed.TotemGUID.IsEmpty() || totem->GetGUID() == totemDestroyed.TotemGUID))
totem->DespawnOrUnsummon();
}
void WorldSession::HandleSelfResOpcode(WorldPackets::Spells::SelfRes& selfRes)