diff options
author | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-02-06 18:47:30 +0000 |
---|---|---|
committer | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-02-06 18:47:30 +0000 |
commit | 4459a6244d44f3be68b01164ae52e3a2f212475e (patch) | |
tree | 763fbe0df7fd5b44ca681717fab719040605bbdb /src/map/pc.c | |
parent | b8cec4ee2c23ca6984f31f21dfa3aa6632e564a0 (diff) | |
download | hercules-4459a6244d44f3be68b01164ae52e3a2f212475e.tar.gz hercules-4459a6244d44f3be68b01164ae52e3a2f212475e.tar.bz2 hercules-4459a6244d44f3be68b01164ae52e3a2f212475e.tar.xz hercules-4459a6244d44f3be68b01164ae52e3a2f212475e.zip |
* Follow up to r13485. (bugreport:2741)
- @spiritball creates spiritballs without timer (limited to the array size instead of 500)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13509 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 89e9f1282..a5ce1d6b5 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -178,7 +178,7 @@ int pc_addspiritball(struct map_session_data *sd,int interval,int max) } tid = add_timer(gettick()+interval, pc_spiritball_timer, sd->bl.id, 0); - ARR_FIND(0, sd->spiritball, i, DIFF_TICK(get_timer(tid)->tick, get_timer(sd->spirit_timer[i])->tick) < 0); + ARR_FIND(0, sd->spiritball, i, sd->spirit_timer[i] == INVALID_TIMER || DIFF_TICK(get_timer(tid)->tick, get_timer(sd->spirit_timer[i])->tick) < 0); if( i != sd->spiritball ) memmove(sd->spirit_timer+i+1, sd->spirit_timer+i, (sd->spiritball-i)*sizeof(int)); sd->spirit_timer[i] = tid; @@ -199,6 +199,8 @@ int pc_delspiritball(struct map_session_data *sd,int count,int type) return 0; } + if(count <= 0) + return 0; if(count > sd->spiritball) count = sd->spiritball; sd->spiritball -= count; |