From dc1c0ca6d41a3cb15a98cda7a324a948f40c90f7 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Sat, 14 Mar 2009 17:17:06 -0600 Subject: Fix some storage-related code You can't end NPC scripts with openstorage, which will now wait for the user. --- src/map/script.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/map/script.c') diff --git a/src/map/script.c b/src/map/script.c index a51f65f..c5bcae1 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -376,7 +376,7 @@ struct { {buildin_gettimetick,"gettimetick","i"}, {buildin_gettime,"gettime","i"}, {buildin_gettimestr,"gettimestr","si"}, - {buildin_openstorage,"openstorage",""}, + {buildin_openstorage,"openstorage","*"}, {buildin_guildopenstorage,"guildopenstorage","*"}, {buildin_itemskill,"itemskill","iis"}, {buildin_monster,"monster","siisii*"}, @@ -3522,8 +3522,16 @@ int buildin_gettimestr(struct script_state *st) */ int buildin_openstorage(struct script_state *st) { - st->state=STOP; - storage_storageopen(script_rid2sd(st)); +// int sync = 0; +// if (st->end >= 3) sync = conv_num(st,& (st->stack->stack_data[st->start+2])); + struct map_session_data *sd=script_rid2sd(st); + +// if (sync) { + st->state=STOP; + sd->npc_flags.storage = 1; +// } else st->state = END; + + storage_storageopen(sd); return 0; } @@ -3531,6 +3539,7 @@ int buildin_guildopenstorage(struct script_state *st) { struct map_session_data *sd=script_rid2sd(st); int ret; + st->state=STOP; ret = storage_guild_storageopen(sd); push_val(st->stack,C_INT,ret); return 0; -- cgit v1.2.3-60-g2f50