summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-19 04:15:32 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-19 04:15:32 +0000
commit2b6f3618d99f725d224859d17344b640e0255d59 (patch)
tree738e3d90ce1bb02b96940e3707074db375867b67 /src
parente9d183dfbdcd8a9aaf71a4db8dbeed43ad574e95 (diff)
downloadhercules-2b6f3618d99f725d224859d17344b640e0255d59.tar.gz
hercules-2b6f3618d99f725d224859d17344b640e0255d59.tar.bz2
hercules-2b6f3618d99f725d224859d17344b640e0255d59.tar.xz
hercules-2b6f3618d99f725d224859d17344b640e0255d59.zip
* Added 'cancel' button parsing in buildin_select menu system. Now scripts will continue to load if 'cancel' is pressed and 255 will be returned.
modified Changelog-Trunk.txt modified notice.txt modified src/map/script.c git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9258 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 650429bcc..8afd23e26 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -10298,21 +10298,23 @@ int buildin_select(struct script_state *st)
}
clif_scriptmenu(script_rid2sd(st),st->oid,buf);
aFree(buf);
- } else if(sd->npc_menu==0xff){ // cansel
- sd->state.menu_or_input=0;
- st->state=END;
- } else {
- //Skip empty menu entries which weren't displayed on the client (Skotlex)
- for(i=st->start+2;i< (st->start+2+sd->npc_menu) && sd->npc_menu < (st->end-st->start-2);i++) {
- conv_str(st,& (st->stack->stack_data[i])); // we should convert variables to strings before access it [jA1983] [EoE]
- if((int)strlen(st->stack->stack_data[i].u.str) < 1)
- sd->npc_menu++; //Empty selection which wasn't displayed on the client.
+ } /*else if(sd->npc_menu==0xff){ // Cancel will be parsed since this is select() [Lance]
+ sd->state.menu_or_input=0;
+ st->state=END;
+ }*/ else {
+ if(sd->npc_menu != 0xff){
+ //Skip empty menu entries which weren't displayed on the client (Skotlex)
+ for(i=st->start+2;i< (st->start+2+sd->npc_menu) && sd->npc_menu < (st->end-st->start-2);i++) {
+ conv_str(st,& (st->stack->stack_data[i])); // we should convert variables to strings before access it [jA1983] [EoE]
+ if((int)strlen(st->stack->stack_data[i].u.str) < 1)
+ sd->npc_menu++; //Empty selection which wasn't displayed on the client.
+ }
}
pc_setreg(sd,add_str((unsigned char *) "@menu"),sd->npc_menu);
sd->state.menu_or_input=0;
push_val(st->stack,C_INT,sd->npc_menu);
- }
- return 0;
+ }
+ return 0;
}
/*==========================================