Fixed bugreport:6200 Prevent server crash when releasing empty spellbooks.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16388 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
b4a0f33eba
commit
88ae2c4c58
@ -4105,6 +4105,9 @@ 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
|
for(i = SC_MAXSPELLBOOK; i >= SC_SPELLBOOK1; i--) // List all available spell to be released
|
||||||
if( sc->data[i] ) spell[s++] = i;
|
if( sc->data[i] ) spell[s++] = i;
|
||||||
|
|
||||||
|
if ( i == 0 )
|
||||||
|
break;
|
||||||
|
|
||||||
i = spell[s==1?0:rand()%s];// Random select of spell to be released.
|
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
|
if( s && sc->data[i] ){// Now extract the data from the preserved spell
|
||||||
skill_id = sc->data[i]->val1;
|
skill_id = sc->data[i]->val1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user