Skip to content

Commit

Permalink
Make use of the new helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyeriah committed Dec 2, 2024
1 parent efd1292 commit 9836b16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mod_chromiecraft_smartstone_scripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class item_chromiecraft_smartstone : public ItemScript
{
player->PlayerTalkClass->ClearMenus();
player->PlayerTalkClass->SendCloseGossip();
if (Creature* cr = ObjectAccessor::GetCreature(*player, player->m_SummonSlot[SUMMON_SLOT_MINIPET]))
if (Creature* cr = player->GetCompanionPet())
cr->DespawnOrUnsummon();

return;
Expand Down Expand Up @@ -102,7 +102,7 @@ class item_chromiecraft_smartstone : public ItemScript
case SMARTSTONE_ACTION_EXOTIC_PET_COLLECTION:
player->PlayerTalkClass->ClearMenus();

if (Creature* cr = ObjectAccessor::GetCreature(*player, player->m_SummonSlot[SUMMON_SLOT_MINIPET]))
if (Creature* cr = player->GetCompanionPet())
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(ACTION_RANGE_SUMMON_PET, 0, "Unsummon current pet", 0, ACTION_RANGE_SUMMON_PET, "", 0);

for (auto const& pet : pets)
Expand Down

0 comments on commit 9836b16

Please sign in to comment.