summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/functions/doors.txt14
1 files changed, 13 insertions, 1 deletions
diff --git a/npc/functions/doors.txt b/npc/functions/doors.txt
index ea223500..72bd6012 100644
--- a/npc/functions/doors.txt
+++ b/npc/functions/doors.txt
@@ -17,7 +17,19 @@ function script doorTouch {
}
function script doorUnTouch {
- if (getareausers() == 0)
+ if (.map$ == "")
+ {
+ if (getmapxy(.@map$, .@x, .@y, UNITTYPE_NPC) != 0)
+ {
+ close;
+ }
+ }
+ else
+ {
+ .@map$ = .map$;
+ }
+
+ if (getareausers(.@map$) == 0)
{
.dir = 4;
initnpctimer;