From d068dff52f8a969008e935b82cfb6a02f5dd204c Mon Sep 17 00:00:00 2001 From: Sean Allen Date: Mon, 24 Feb 2014 03:10:36 +0800 Subject: [PATCH] Update script.c - Update instance_enter --- src/map/script.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/src/map/script.c b/src/map/script.c index 9f44effb9a..693b257fc4 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -16901,28 +16901,11 @@ BUILDIN_FUNC(instance_enter) { struct map_session_data *sd; - if((sd = script_rid2sd(st)) != NULL) - script_pushint(st,instance_enter(sd,script_getstr(st, 2))); - else - return 1; - return SCRIPT_CMD_SUCCESS; - -} - -/*========================================== - * Warps player to instance at the specified coordinates [CairoLee] - * Results: - * 0: Success - * 1: Character not in party - * 2: Party doesn't have instance - * 3: Other errors (instance not in DB, instance doesn't match with party, etc.) - *------------------------------------------*/ -BUILDIN_FUNC(instance_enter2) -{ - struct map_session_data *sd; - if((sd = script_rid2sd(st)) != NULL){ - script_pushint(st,instance_enter_position(sd,script_getstr(st, 2),script_getnum(st, 3),script_getnum(st, 4))); + if (script_hasdata(st,3) && script_hasdata(st,4)) + script_pushint(st,instance_enter_position(sd,script_getstr(st, 2),script_getnum(st, 3),script_getnum(st, 4))); + else + script_pushint(st,instance_enter(sd,script_getstr(st, 2))); } else return 1;