Skip to content

Commit

Permalink
Fix to skill_blockpc_end
Browse files Browse the repository at this point in the history
Duplicate indexes would not be cleared, causing array to gradually increase in size.
Thanks to ToiletMaster for providing extra information.

Signed-off-by: shennetsind <ind@henn.et>
  • Loading branch information
shennetsind committed Jul 11, 2013
1 parent 610b7ce commit ba16e1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/map/skill.c
Original file line number Diff line number Diff line change
Expand Up @@ -16969,7 +16969,6 @@ int skill_blockpc_end(int tid, unsigned int tick, int id, intptr_t data) {
if (data <= 0 || data >= MAX_SKILL)
return 0;
if (!sd) return 0;
if (sd->blockskill[data] != (0x1|(tid&0xFE))) return 0;

if( ( cd = idb_get(skill->cd_db,sd->status.char_id) ) ) {
int i;
Expand Down Expand Up @@ -17002,6 +17001,8 @@ int skill_blockpc_end(int tid, unsigned int tick, int id, intptr_t data) {
}
}
}

if (sd->blockskill[data] != (0x1|(tid&0xFE))) return 0;

sd->blockskill[data] = 0;
return 1;
Expand Down

0 comments on commit ba16e1a

Please sign in to comment.