From c73cd00ae16ee8235f7e2929dfafabdeacbc4745 Mon Sep 17 00:00:00 2001 From: shinomori Date: Tue, 15 Feb 2005 09:44:00 +0000 Subject: fixed the spiritball timer list [Shinomori] git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1109 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/pc.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/map') diff --git a/src/map/pc.c b/src/map/pc.c index 8fb4188f8..80d15187d 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -183,7 +183,9 @@ static int pc_spiritball_timer(int tid,unsigned int tick,int id,int data) { } sd->spiritball--; - memcpy( &sd->spirit_timer[0], &sd->spirit_timer[1], sizeof(sd->spirit_timer[0]) * sd->spiritball ); + // I leave this here as bad example [Shinomori] + //memcpy( &sd->spirit_timer[0], &sd->spirit_timer[1], sizeof(sd->spirit_timer[0]) * sd->spiritball ); + memmove( sd->spirit_timer+0, sd->spirit_timer+1, (sd->spiritball)*sizeof(int) ); sd->spirit_timer[sd->spiritball]=-1; clif_spiritball(sd); @@ -202,7 +204,10 @@ int pc_addspiritball(struct map_session_data *sd,int interval,int max) { if(sd->spiritball >= max) { if(sd->spirit_timer[0] != -1) delete_timer(sd->spirit_timer[0],pc_spiritball_timer); - memcpy( &sd->spirit_timer[0], &sd->spirit_timer[1], sizeof(sd->spirit_timer[0]) * (sd->spiritball - 1)); + // I leave this here as bad example [Shinomori] + //memcpy( &sd->spirit_timer[0], &sd->spirit_timer[1], sizeof(sd->spirit_timer[0]) * (sd->spiritball - 1)); + memmove( sd->spirit_timer+0, sd->spirit_timer+1, (sd->spiritball - 1)*sizeof(int) ); + //sd->spirit_timer[sd->spiritball-1] = -1; // intentionally, but will be overwritten } else sd->spiritball++; @@ -3007,14 +3012,14 @@ static int pc_walk(int tid,unsigned int tick,int id,int data) sd->inchealspiritsptick = 0; sd->walkpath.path_half ^= 1; - if(sd->walkpath.path_half==0){ // マス目中心へ途 + if(sd->walkpath.path_half==0){ // マス目中心へ途 sd->walkpath.path_pos++; if(sd->state.change_walk_target){ pc_walktoxy_sub(sd); return 0; } - } else { // マス目境界へ途 + } else { // マス目境界へ途 if(sd->walkpath.path[sd->walkpath.path_pos]>=8) return 1; -- cgit v1.2.3-70-g09d2