- Added support for skipping empty string menu entries for the select() command (just as menu has it already)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8816 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-09-19 23:06:42 +00:00
parent c86c748d9d
commit 2beeeee85c
2 changed files with 8 additions and 1 deletions

View File

@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/09/19 2006/09/19
* Added support for skipping empty string menu entries for the select()
command (just as `menu` has it already) [Skotlex]
* Fixed pc_set_hate_mob letting you place mobs on any of the three * Fixed pc_set_hate_mob letting you place mobs on any of the three
positions regardless of size [Skotlex] positions regardless of size [Skotlex]
* The double continuation error will now display both scripts that * The double continuation error will now display both scripts that

View File

@ -10219,7 +10219,12 @@ int buildin_select(struct script_state *st)
sd->state.menu_or_input=0; sd->state.menu_or_input=0;
st->state=END; st->state=END;
} else { } 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); pc_setreg(sd,add_str((unsigned char *) "@menu"),sd->npc_menu);
sd->state.menu_or_input=0; sd->state.menu_or_input=0;
push_val(st->stack,C_INT,sd->npc_menu); push_val(st->stack,C_INT,sd->npc_menu);