summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-22 01:02:46 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-22 01:02:46 +0000
commit0b5b0bfe8def6fd822e0cbabab5aec96a4e50606 (patch)
treea23528222b3a26996f25d96b3ae5316304826437
parent1441a347a96cffe355f66c33578c5976b9f379a8 (diff)
downloadhercules-0b5b0bfe8def6fd822e0cbabab5aec96a4e50606.tar.gz
hercules-0b5b0bfe8def6fd822e0cbabab5aec96a4e50606.tar.bz2
hercules-0b5b0bfe8def6fd822e0cbabab5aec96a4e50606.tar.xz
hercules-0b5b0bfe8def6fd822e0cbabab5aec96a4e50606.zip
- Fixed a bug on "select" when skipping empty entries when the selected entry is the last.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8839 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/map/script.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 27b20fd7f..06e55eba9 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -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.
2006/09/21
+ * Fixed a bug on "select" when skipping empty entries when the selected
+ entry is the last. [Skotlex]
* Improved a bit RFIFOFLUSH as suggested by Harbin. [Skotlex]
2006/09/20
* A mob's HP is set temporarily to 0 before invoking it's on-death script,
diff --git a/src/map/script.c b/src/map/script.c
index 1d8436047..d8bbe4aa2 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -10220,7 +10220,7 @@ int buildin_select(struct script_state *st)
st->state=END;
} else {
//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++) {
+ 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.