Fixed a copy-paste typo in r11112.
Applied the useful ARR_FIND() macro to 4 item bonuses. git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11113 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
88e0559d2c
commit
21f57419f0
@ -2215,7 +2215,7 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
|
|||||||
case SP_SKILL_ATK:
|
case SP_SKILL_ATK:
|
||||||
if(sd->state.lr_flag == 2)
|
if(sd->state.lr_flag == 2)
|
||||||
break;
|
break;
|
||||||
for (i = 0; i < ARRAYLENGTH(sd->skillatk) && sd->skillatk[i].id != 0 && sd->skillatk[i].id != type2; i++);
|
ARR_FIND(0, ARRAYLENGTH(sd->skillatk), i, sd->skillatk[i].id == 0 && sd->skillatk[i].id == type2);
|
||||||
if (i == ARRAYLENGTH(sd->skillatk))
|
if (i == ARRAYLENGTH(sd->skillatk))
|
||||||
{ //Better mention this so the array length can be updated. [Skotlex]
|
{ //Better mention this so the array length can be updated. [Skotlex]
|
||||||
ShowDebug("run_script: bonus2 bSkillAtk reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n", ARRAYLENGTH(sd->skillatk), type2, val);
|
ShowDebug("run_script: bonus2 bSkillAtk reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n", ARRAYLENGTH(sd->skillatk), type2, val);
|
||||||
@ -2231,7 +2231,7 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
|
|||||||
case SP_SKILL_HEAL:
|
case SP_SKILL_HEAL:
|
||||||
if(sd->state.lr_flag == 2)
|
if(sd->state.lr_flag == 2)
|
||||||
break;
|
break;
|
||||||
for (i = 0; i < ARRAYLENGTH(sd->skillheal) && sd->skillheal[i].id != 0 && sd->skillheal[i].id != type2; i++);
|
ARR_FIND(0, ARRAYLENGTH(sd->skillheal), i, sd->skillheal[i].id == 0 && sd->skillheal[i].id == type2);
|
||||||
if (i == ARRAYLENGTH(sd->skillheal))
|
if (i == ARRAYLENGTH(sd->skillheal))
|
||||||
{ //Better mention this so the array length can be updated. [Skotlex]
|
{ //Better mention this so the array length can be updated. [Skotlex]
|
||||||
ShowDebug("run_script: bonus2 bSkillHeal reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n", ARRAYLENGTH(sd->skillheal), type2, val);
|
ShowDebug("run_script: bonus2 bSkillHeal reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n", ARRAYLENGTH(sd->skillheal), type2, val);
|
||||||
@ -2247,7 +2247,7 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
|
|||||||
case SP_ADD_SKILL_BLOW:
|
case SP_ADD_SKILL_BLOW:
|
||||||
if(sd->state.lr_flag == 2)
|
if(sd->state.lr_flag == 2)
|
||||||
break;
|
break;
|
||||||
for (i = 0; i < ARRAYLENGTH(sd->skillblown) && sd->skillblown[i].id && sd->skillblown[i].id != type2; i++);
|
ARR_FIND(0, ARRAYLENGTH(sd->skillblown), i, sd->skillblown[i].id == 0 && sd->skillblown[i].id == type2);
|
||||||
if (i == ARRAYLENGTH(sd->skillblown))
|
if (i == ARRAYLENGTH(sd->skillblown))
|
||||||
{ //Better mention this so the array length can be updated. [Skotlex]
|
{ //Better mention this so the array length can be updated. [Skotlex]
|
||||||
ShowDebug("run_script: bonus2 bSkillBlown reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n", ARRAYLENGTH(sd->skillblown), type2, val);
|
ShowDebug("run_script: bonus2 bSkillBlown reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n", ARRAYLENGTH(sd->skillblown), type2, val);
|
||||||
@ -2264,7 +2264,7 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
|
|||||||
case SP_CASTRATE:
|
case SP_CASTRATE:
|
||||||
if(sd->state.lr_flag == 2)
|
if(sd->state.lr_flag == 2)
|
||||||
break;
|
break;
|
||||||
for (i = 0; i < ARRAYLENGTH(sd->skillcast) && sd->skillcast[i].id && sd->skillblown[i].id != type2; i++);
|
ARR_FIND(0, ARRAYLENGTH(sd->skillcast), i, sd->skillcast[i].id == 0 && sd->skillcast[i].id == type2);
|
||||||
if (i == ARRAYLENGTH(sd->skillcast))
|
if (i == ARRAYLENGTH(sd->skillcast))
|
||||||
{ //Better mention this so the array length can be updated. [Skotlex]
|
{ //Better mention this so the array length can be updated. [Skotlex]
|
||||||
ShowDebug("run_script: bonus2 bCastRate reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n", ARRAYLENGTH(sd->skillcast), type2, val);
|
ShowDebug("run_script: bonus2 bCastRate reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n", ARRAYLENGTH(sd->skillcast), type2, val);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user