Skip to content

Commit

Permalink
Cleanup unused function pointers in ScriptMgr.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb committed Feb 8, 2025
1 parent dccd82c commit 4e53e46
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/game/ScriptMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2009,10 +2009,10 @@ bool ScriptMgr::OnGameObjectOpen(Player* pPlayer, GameObject* pGameObject)
{
Script* pTempScript = m_scripts[pGameObject->GetGOInfo()->ScriptId];

if (!pTempScript || !pTempScript->GOOpen)
if (!pTempScript || !pTempScript->pGOOpen)
return false;

return pTempScript->GOOpen(pPlayer, pGameObject);
return pTempScript->pGOOpen(pPlayer, pGameObject);
}

bool ScriptMgr::OnGameObjectUse(Player* pPlayer, GameObject* pGameObject)
Expand Down
19 changes: 7 additions & 12 deletions src/game/ScriptMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,43 +166,38 @@ struct Script
Name(""), pGossipHello(nullptr), pGOGossipHello(nullptr), pQuestAcceptNPC(nullptr),
pGossipSelect(nullptr), pGOGossipSelect(nullptr),
pGossipSelectWithCode(nullptr), pGOGossipSelectWithCode(nullptr), pQuestComplete(nullptr),
pNPCDialogStatus(nullptr), pGODialogStatus(nullptr), pQuestRewardedNPC(nullptr), pQuestRewardedGO(nullptr), pItemHello(nullptr), pGOHello(nullptr), pAreaTrigger(nullptr),
pProcessEventId(nullptr), pItemQuestAccept(nullptr), pGOQuestAccept(nullptr),
pItemUse(nullptr), pEffectDummyCreature(nullptr), pEffectDummyGameObj(nullptr),
pEffectAuraDummy(nullptr), GOOpen(nullptr),
pNPCDialogStatus(nullptr), pGODialogStatus(nullptr), pQuestRewardedNPC(nullptr), pQuestRewardedGO(nullptr), pGOHello(nullptr), pAreaTrigger(nullptr),
pProcessEventId(nullptr), pGOQuestAccept(nullptr),
pEffectDummyCreature(nullptr), pEffectDummyGameObj(nullptr),
pEffectAuraDummy(nullptr), pGOOpen(nullptr),
GOGetAI(nullptr), GetAI(nullptr), GetInstanceData(nullptr), GetSpellScript(nullptr)
{}

std::string Name;

//Methods to be scripted
// Methods to be scripted
bool (*pGossipHello )(Player*, Creature*);
bool (*pGOGossipHello )(Player*, GameObject*);
bool (*pQuestAcceptNPC )(Player*, Creature*, Quest const*);
bool (*pGossipSelect )(Player*, Creature*, uint32, uint32);
bool (*pGOGossipSelect )(Player*, GameObject*, uint32, uint32);
bool (*pGossipSelectWithCode )(Player*, Creature*, uint32, uint32, char const*);
bool (*pGOGossipSelectWithCode )(Player*, GameObject*, uint32, uint32, char const*);
// bool (*pQuestSelect )(Player*, Creature*, Quest const*);
bool (*pQuestComplete )(Player*, Creature*, Quest const*);
uint32 (*pNPCDialogStatus )(Player*, Creature*);
uint32 (*pGODialogStatus )(Player*, GameObject*);
bool (*pQuestRewardedNPC )(Player*, Creature*, Quest const*);
bool (*pQuestRewardedGO )(Player*, GameObject*, Quest const*);
bool (*pItemHello )(Player*, Item*, Quest const*);
bool (*pGOHello )(Player*, GameObject*);
bool (*pAreaTrigger )(Player*, AreaTriggerEntry const*);
bool (*pProcessEventId )(uint32, Object*, Object*, bool);
bool (*pItemQuestAccept )(Player*, Item*, Quest const*);
bool (*pGOQuestAccept )(Player*, GameObject*, Quest const*);
// bool (*pGOChooseReward )(Player*, GameObject*, Quest const*, uint32);
bool (*pItemUse )(Player*, Item*, SpellCastTargets const&);
bool (*pEffectDummyCreature )(WorldObject*, uint32, SpellEffectIndex, Creature*);
bool (*pEffectDummyGameObj )(WorldObject*, uint32, SpellEffectIndex, GameObject*);
bool (*pEffectAuraDummy )(Aura const*, bool);
bool (*GOOpen )(Player* pUser, GameObject* gobj);
bool (*pGOOpen )(Player* pUser, GameObject* gobj);

GameObjectAI* (*GOGetAI )(GameObject* pGo);
GameObjectAI* (*GOGetAI)(GameObject* pGo);
CreatureAI* (*GetAI)(Creature*);
InstanceData* (*GetInstanceData)(Map*);
SpellScript* (*GetSpellScript)(SpellEntry const*);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ void AddSC_stratholme()

newscript = new Script;
newscript->Name = "go_stratholme_postbox";
newscript->GOOpen = &GOOpen_go_stratholme_postbox;
newscript->pGOOpen = &GOOpen_go_stratholme_postbox;
newscript->RegisterSelf();

newscript = new Script;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ void AddSC_instance_scholomance()

newscript = new Script;
newscript->Name = "go_brazier_herald";
newscript->GOOpen = &GOOpen_brazier_herald;
newscript->pGOOpen = &GOOpen_brazier_herald;
newscript->RegisterSelf();

newscript = new Script;
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/kalimdor/tanaris/zulfarrak/zulfarrak.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ void AddSC_go_shallow_grave()
Script* pNewScript;
pNewScript = new Script;
pNewScript->Name = "go_shallow_grave";
pNewScript->GOOpen = &OnGossipHello_go_shallow_grave;
pNewScript->pGOOpen = &OnGossipHello_go_shallow_grave;
pNewScript->RegisterSelf();
}
/*######
Expand Down

0 comments on commit 4e53e46

Please sign in to comment.