mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 17:49:10 +00:00
fix(Core/Scripts): Fix bool script hooks not executing code (#9699)
* fix(Core/Scripts): Fix bool script hooks not executing code * warnings
This commit is contained in:
@@ -31,12 +31,16 @@ bool ScriptMgr::OnGossipHello(Player* player, Creature* creature)
|
||||
|
||||
if (ret && *ret)
|
||||
{
|
||||
if (auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId()))
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
return tempScript->OnGossipHello(player, creature);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId());
|
||||
ClearGossipMenuFor(player);
|
||||
return tempScript ? tempScript->OnGossipHello(player, creature) : false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action)
|
||||
@@ -51,11 +55,15 @@ bool ScriptMgr::OnGossipSelect(Player* player, Creature* creature, uint32 sender
|
||||
|
||||
if (ret && *ret)
|
||||
{
|
||||
if (auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId()))
|
||||
{
|
||||
return tempScript->OnGossipSelect(player, creature, sender, action);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId());
|
||||
return tempScript ? tempScript->OnGossipSelect(player, creature, sender, action) : false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnGossipSelectCode(Player* player, Creature* creature, uint32 sender, uint32 action, const char* code)
|
||||
@@ -71,11 +79,15 @@ bool ScriptMgr::OnGossipSelectCode(Player* player, Creature* creature, uint32 se
|
||||
|
||||
if (ret && *ret)
|
||||
{
|
||||
if (auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId()))
|
||||
{
|
||||
return tempScript->OnGossipSelectCode(player, creature, sender, action, code);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId());
|
||||
return tempScript ? tempScript->OnGossipSelectCode(player, creature, sender, action, code) : false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
|
||||
@@ -91,12 +103,16 @@ bool ScriptMgr::OnQuestAccept(Player* player, Creature* creature, Quest const* q
|
||||
|
||||
if (ret && *ret)
|
||||
{
|
||||
if (auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId()))
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
return tempScript->OnQuestAccept(player, creature, quest);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId());
|
||||
ClearGossipMenuFor(player);
|
||||
return tempScript ? tempScript->OnQuestAccept(player, creature, quest) : false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnQuestSelect(Player* player, Creature* creature, Quest const* quest)
|
||||
@@ -134,12 +150,16 @@ bool ScriptMgr::OnQuestReward(Player* player, Creature* creature, Quest const* q
|
||||
|
||||
if (ret && *ret)
|
||||
{
|
||||
if (auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId()))
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
return tempScript->OnQuestReward(player, creature, quest, opt);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId());
|
||||
ClearGossipMenuFor(player);
|
||||
return tempScript ? tempScript->OnQuestReward(player, creature, quest, opt) : false;
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 ScriptMgr::GetDialogStatus(Player* player, Creature* creature)
|
||||
|
||||
@@ -31,12 +31,16 @@ bool ScriptMgr::OnGossipHello(Player* player, GameObject* go)
|
||||
|
||||
if (ret && *ret)
|
||||
{
|
||||
if (auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId()))
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
return tempScript->OnGossipHello(player, go);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId());
|
||||
ClearGossipMenuFor(player);
|
||||
return tempScript ? tempScript->OnGossipHello(player, go) : false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnGossipSelect(Player* player, GameObject* go, uint32 sender, uint32 action)
|
||||
@@ -51,11 +55,15 @@ bool ScriptMgr::OnGossipSelect(Player* player, GameObject* go, uint32 sender, ui
|
||||
|
||||
if (ret && *ret)
|
||||
{
|
||||
if (auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId()))
|
||||
{
|
||||
return tempScript->OnGossipSelect(player, go, sender, action);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId());
|
||||
return tempScript ? tempScript->OnGossipSelect(player, go, sender, action) : false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnGossipSelectCode(Player* player, GameObject* go, uint32 sender, uint32 action, const char* code)
|
||||
@@ -71,11 +79,15 @@ bool ScriptMgr::OnGossipSelectCode(Player* player, GameObject* go, uint32 sender
|
||||
|
||||
if (ret && *ret)
|
||||
{
|
||||
if (auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId()))
|
||||
{
|
||||
return tempScript->OnGossipSelectCode(player, go, sender, action, code);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId());
|
||||
return tempScript ? tempScript->OnGossipSelectCode(player, go, sender, action, code) : false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnQuestAccept(Player* player, GameObject* go, Quest const* quest)
|
||||
@@ -91,12 +103,16 @@ bool ScriptMgr::OnQuestAccept(Player* player, GameObject* go, Quest const* quest
|
||||
|
||||
if (ret && *ret)
|
||||
{
|
||||
if (auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId()))
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
return tempScript->OnQuestAccept(player, go, quest);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId());
|
||||
ClearGossipMenuFor(player);
|
||||
return tempScript ? tempScript->OnQuestAccept(player, go, quest) : false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnQuestReward(Player* player, GameObject* go, Quest const* quest, uint32 opt)
|
||||
@@ -112,12 +128,17 @@ bool ScriptMgr::OnQuestReward(Player* player, GameObject* go, Quest const* quest
|
||||
|
||||
if (ret && *ret)
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
|
||||
if (auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId()))
|
||||
{
|
||||
return tempScript->OnQuestReward(player, go, quest, opt);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId());
|
||||
ClearGossipMenuFor(player);
|
||||
return tempScript ? tempScript->OnQuestReward(player, go, quest, opt) : false;
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 ScriptMgr::GetDialogStatus(Player* player, GameObject* go)
|
||||
|
||||
Reference in New Issue
Block a user