diff --git a/HttpManager.cpp b/HttpManager.cpp index ccaeee4..80d6b29 100644 --- a/HttpManager.cpp +++ b/HttpManager.cpp @@ -210,7 +210,7 @@ httplib::Result HttpManager::DoRequest(httplib::Client& client, HttpWorkItem* re return client.Options(path, req->headers); } - ELUNA_LOG_ERROR("[Eluna]: HTTP request error: invalid HTTP verb {}", req->httpVerb)); + ELUNA_LOG_ERROR("[Eluna]: HTTP request error: invalid HTTP verb {}", req->httpVerb); return client.Get(path, req->headers); } diff --git a/LuaEngine.h b/LuaEngine.h index e90b037..aae41bc 100644 --- a/LuaEngine.h +++ b/LuaEngine.h @@ -450,7 +450,7 @@ public: void OnTalentsReset(Player* pPlayer, bool noCost); void OnMoneyChanged(Player* pPlayer, int32& amount); void OnGiveXP(Player* pPlayer, uint32& amount, Unit* pVictim); - void OnReputationChange(Player* pPlayer, uint32 factionID, int32& standing, bool incremental); + bool OnReputationChange(Player* pPlayer, uint32 factionID, int32& standing, bool incremental); void OnDuelRequest(Player* pTarget, Player* pChallenger); void OnDuelStart(Player* pStarter, Player* pChallenger); void OnDuelEnd(Player* pWinner, Player* pLoser, DuelCompleteType type); diff --git a/PlayerHooks.cpp b/PlayerHooks.cpp index a229b21..23171b2 100644 --- a/PlayerHooks.cpp +++ b/PlayerHooks.cpp @@ -251,9 +251,10 @@ void Eluna::OnGiveXP(Player* pPlayer, uint32& amount, Unit* pVictim) CleanUpStack(3); } -void Eluna::OnReputationChange(Player* pPlayer, uint32 factionID, int32& standing, bool incremental) +bool Eluna::OnReputationChange(Player* pPlayer, uint32 factionID, int32& standing, bool incremental) { - START_HOOK(PLAYER_EVENT_ON_REPUTATION_CHANGE); + START_HOOK_WITH_RETVAL(PLAYER_EVENT_ON_REPUTATION_CHANGE, true); + bool result = true; Push(pPlayer); Push(factionID); Push(standing); @@ -268,6 +269,8 @@ void Eluna::OnReputationChange(Player* pPlayer, uint32 factionID, int32& standin if (lua_isnumber(L, r)) { standing = CHECKVAL(L, r); + if (standing == -1) + result = false; // Update the stack for subsequent calls. ReplaceArgument(standing, standingIndex); } @@ -276,6 +279,7 @@ void Eluna::OnReputationChange(Player* pPlayer, uint32 factionID, int32& standin } CleanUpStack(4); + return result; } void Eluna::OnDuelRequest(Player* pTarget, Player* pChallenger)