diff --git a/EQ2/source/WorldServer/LuaFunctions.cpp b/EQ2/source/WorldServer/LuaFunctions.cpp index 68c5755ad..49cc7358b 100644 --- a/EQ2/source/WorldServer/LuaFunctions.cpp +++ b/EQ2/source/WorldServer/LuaFunctions.cpp @@ -4479,8 +4479,10 @@ int EQ2Emu_lua_IsGateAllowed(lua_State* state) { if (spawn) { if (spawn->IsPlayer()) { Client* client = spawn->GetZone()->GetClientBySpawn(spawn); - if (client) - ret = client->GateAllowed(); + ZoneServer* zone = lua_interface->GetZone(state); + if (client && zone){ + ret = zone->GetCanGate(); + } } } lua_interface->SetBooleanValue(state, ret); diff --git a/EQ2/source/WorldServer/client.cpp b/EQ2/source/WorldServer/client.cpp index b626eff46..fa9c87a51 100644 --- a/EQ2/source/WorldServer/client.cpp +++ b/EQ2/source/WorldServer/client.cpp @@ -8352,8 +8352,8 @@ void Client::ResetSendMail(bool cancel, bool needslock) { bool Client::GateAllowed() { ZoneServer* zone = GetCurrentZone(); - bool cangate = zone->GetCanGate(); if (zone){ + bool cangate = zone->GetCanGate(); return cangate; } diff --git a/server/Spells/Commoner/CalltoHome.lua b/server/Spells/Commoner/CalltoHome.lua index ee9e3a7a3..69a3c91f0 100755 --- a/server/Spells/Commoner/CalltoHome.lua +++ b/server/Spells/Commoner/CalltoHome.lua @@ -9,10 +9,19 @@ -- Teleports you to your recall point. function precast(Caster, Target) if GetBoundZoneID(Caster) == 0 then + SendMessage(Caster, "You are a failure", "red") return false end - return true + if(IsGateAllowed(Caster)) + then + return true + else + SendMessage(Caster, "You cannot use Call to Home from this location.", "red") + return false + end + + return true end function cast(Caster, Target)