From 5078989542df030741ed3f1acd79d438052c13c9 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Tue, 28 Jul 2020 22:07:51 -0300 Subject: When player is exiled from a town, if they already were saved there, unsave. --- npc/functions/politics.txt | 2 ++ npc/functions/util.txt | 7 +++++++ 2 files changed, 9 insertions(+) (limited to 'npc/functions') diff --git a/npc/functions/politics.txt b/npc/functions/politics.txt index 44d26b6ab..58c1a2d71 100644 --- a/npc/functions/politics.txt +++ b/npc/functions/politics.txt @@ -460,6 +460,8 @@ function script POL_Manage { attachrid(.@id); dispbottom l("You have been EXILED from %s by %s.", getarg(0), .@MAYOR$); #EXILED=#EXILED|.@town; + if (getsavepoint(0) == LocToMap(TPToLoc(.@town))) + savepoint "000-1", 22, 22; detachrid(); attachrid(.@you); kamibroadcast(sprintf("%s has EXILED %s from %s.", diff --git a/npc/functions/util.txt b/npc/functions/util.txt index 1b088cdcc..95087455e 100644 --- a/npc/functions/util.txt +++ b/npc/functions/util.txt @@ -1005,6 +1005,13 @@ function script MapToLoc { return $@LOCMASTER_LOC$[.@lx]; } +// Gets the location code for TP code +function script TPToLoc { + .@i=array_find($@LOCMASTER_TP, getarg(0)); + return $@LOCMASTER_MAP$[.@i]; + return; +} + // Warps home and updates LOCATION$ function script teleporthome { warp "Save", 0, 0; -- cgit v1.2.3-70-g09d2