File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 1515 * with this program. If not, see <http://www.gnu.org/licenses/>.
1616 */
1717
18- #include " WorldSession.h"
1918#include " Archaeology.h"
2019#include " Common.h"
2120#include " Config.h"
22- #include " DatabaseEnv.h"
2321#include " DBCStores.h"
22+ #include " DatabaseEnv.h"
2423#include " GameClient.h"
2524#include " GameObject.h"
2625#include " GameObjectAI.h"
3938#include " SpellCastRequest.h"
4039#include " SpellMgr.h"
4140#include " SpellPackets.h"
41+ #include " SummonInfo.h"
4242#include " Totem.h"
4343#include " TotemPackets.h"
4444#include " World.h"
4545#include " WorldPacket.h"
46+ #include " WorldSession.h"
4647
4748void WorldSession::HandleClientCastFlags (WorldPacket& recvPacket, uint8 castFlags, SpellCastTargets& targets)
4849{
@@ -423,15 +424,15 @@ void WorldSession::HandleTotemDestroyed(WorldPackets::Totem::TotemDestroyed& pac
423424 if (_player->IsCharming ())
424425 return ;
425426
426- if (packet.Slot +1 >= MAX_TOTEM_SLOT)
427+ SummonPropertiesSlot slot = static_cast <SummonPropertiesSlot>(packet.Slot + 1 );
428+ if (slot < SummonPropertiesSlot::Totem1 || slot > SummonPropertiesSlot::Totem4)
427429 return ;
428430
429- if (!_player->m_SummonSlot [packet.Slot + 1 ])
431+ SummonInfo* summonInfo = _player->GetSummonInSlot (slot);
432+ if (!summonInfo)
430433 return ;
431434
432- Creature* totem = ObjectAccessor::GetCreature (*GetPlayer (), _player->m_SummonSlot [packet.Slot + 1 ]);
433- if (totem && totem->IsTotem () && totem->GetGUID () == packet.TotemGUID )
434- totem->ToTotem ()->UnSummon ();
435+ summonInfo->GetSummonedCreature ()->DespawnOrUnsummon ();
435436}
436437
437438void WorldSession::HandleSelfResOpcode (WorldPacket& /* recvData*/ )
You can’t perform that action at this time.
0 commit comments