Cleanup of new gate code. Added messages when a gate fails due to location disabled. Modified the call to home lua to work as expected.
This commit is contained in:
parent
c095bd9b2d
commit
d7caa38cd3
3 changed files with 15 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue