summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index f6aef06a2..122a3fb8d 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -4105,8 +4105,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
for(i = SC_MAXSPELLBOOK; i >= SC_SPELLBOOK1; i--) // List all available spell to be released
if( sc->data[i] ) spell[s++] = i;
- if ( i == 0 )
- break;
+ if ( s == 0 )
+ break;
i = spell[s==1?0:rand()%s];// Random select of spell to be released.
if( s && sc->data[i] ){// Now extract the data from the preserved spell