summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-19 23:06:42 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-19 23:06:42 +0000
commit263a6ed472cf53802701a41577b96a62c571c10f (patch)
tree01361d3a859892ef77a614340bea5225cd08bff0 /src/map/script.c
parent5ebe04fedf0f0220aabce05472d7cb7aed4acc01 (diff)
downloadhercules-263a6ed472cf53802701a41577b96a62c571c10f.tar.gz
hercules-263a6ed472cf53802701a41577b96a62c571c10f.tar.bz2
hercules-263a6ed472cf53802701a41577b96a62c571c10f.tar.xz
hercules-263a6ed472cf53802701a41577b96a62c571c10f.zip
- Added support for skipping empty string menu entries for the select() command (just as `menu` has it already)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8816 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 805bfe0c2..1d8436047 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -10219,7 +10219,12 @@ int buildin_select(struct script_state *st)
sd->state.menu_or_input=0;
st->state=END;
} else {
-// pc_setreg(sd,add_str((unsigned char *) "l15"),sd->npc_menu);
+ //Skip empty menu entries which weren't displayed on the client (Skotlex)
+ for(i=st->start+2;i<= (st->start+sd->npc_menu) && sd->npc_menu<(st->end-st->start);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);