From 362a86d3f779961f960fd974fafc10f1a5c32859 Mon Sep 17 00:00:00 2001 From: Emagi Date: Thu, 12 Sep 2024 09:44:05 -0400 Subject: [PATCH] fix HasCoin to check if player before casting it --- source/WorldServer/LuaFunctions.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/WorldServer/LuaFunctions.cpp b/source/WorldServer/LuaFunctions.cpp index acbb5ff..e0ae772 100644 --- a/source/WorldServer/LuaFunctions.cpp +++ b/source/WorldServer/LuaFunctions.cpp @@ -9524,7 +9524,7 @@ int EQ2Emu_lua_CureByControlEffect(lua_State* state) { LuaSpell* spell = lua_interface->GetCurrentSpell(state); - if(spell && spell->resisted) { + if(spell->resisted) { lua_interface->ResetFunctionStack(state); return 0; } @@ -13684,12 +13684,12 @@ int EQ2Emu_lua_ChangeFaction(lua_State* state) { int EQ2Emu_lua_HasCoin(lua_State* state) { bool hascoin = 0; - Player* player = (Player*)lua_interface->GetSpawn(state); + Spawn* player = lua_interface->GetSpawn(state); int32 coins = lua_interface->GetInt32Value(state, 2); lua_interface->ResetFunctionStack(state); if (player && player->IsPlayer()) { - hascoin = player->HasCoins(coins); + hascoin = ((Player*)player)->HasCoins(coins); if(hascoin == 0) { lua_interface->SetBooleanValue(state, false); return 1;