summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-07-03 08:37:28 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-07-03 08:37:28 +0000
commitdbd1f8cd60a0ac82e6161fefe5308475e8f124c0 (patch)
tree1af2dee86b06583fc1df00319b5fc4a1dc3a7f54
parent0acd37664f6f39a1cbc0c95ec598b2c32016d9f4 (diff)
downloadhercules-dbd1f8cd60a0ac82e6161fefe5308475e8f124c0.tar.gz
hercules-dbd1f8cd60a0ac82e6161fefe5308475e8f124c0.tar.bz2
hercules-dbd1f8cd60a0ac82e6161fefe5308475e8f124c0.tar.xz
hercules-dbd1f8cd60a0ac82e6161fefe5308475e8f124c0.zip
bugreport:6137 fixed a bug that allowed item delays to be bypassed when a empty slot was found in the item delay array (e.g. a delay from other item was cleared and left the slot empty). also fixed a issue with the seconds display.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16371 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/map/pc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 7da3a7459..7d464cbc9 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4124,8 +4124,10 @@ int pc_useitem(struct map_session_data *sd,int n)
if( sd->inventory_data[n]->flag.delay_consume && ( sd->ud.skilltimer != INVALID_TIMER /*|| !status_check_skilluse(&sd->bl, &sd->bl, ALL_RESURRECTION, 0)*/ ) )
return 0;
- if( sd->inventory_data[n]->delay > 0 ) { // Check if there is a delay on this item [Paradox924X]
- ARR_FIND(0, MAX_ITEMDELAYS, i, sd->item_delay[i].nameid == nameid || !sd->item_delay[i].nameid);
+ if( sd->inventory_data[n]->delay > 0 ) {
+ ARR_FIND(0, MAX_ITEMDELAYS, i, sd->item_delay[i].nameid == nameid );
+ if( i == MAX_ITEMDELAYS ) /* item not found. try first empty now */
+ ARR_FIND(0, MAX_ITEMDELAYS, i, !sd->item_delay[i].nameid );
if( i < MAX_ITEMDELAYS ) {
if( sd->item_delay[i].nameid ) {// found
if( DIFF_TICK(sd->item_delay[i].tick, tick) > 0 ) {
@@ -4138,7 +4140,7 @@ int pc_useitem(struct map_session_data *sd,int n)
else
sprintf(e_msg,"Item Failed. [%s] is cooling down. wait %d seconds.",
itemdb_jname(sd->status.inventory[n].nameid),
- e_tick);
+ e_tick+1);
clif_colormes(sd,COLOR_RED,e_msg);
return 0; // Delay has not expired yet
}