diff options
-rw-r--r-- | src/map/atcommand.c | 3 | ||||
-rw-r--r-- | src/map/pc.c | 8 | ||||
-rw-r--r-- | src/map/status.c | 6 |
3 files changed, 10 insertions, 7 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 3976c8427..be68a399e 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -2051,9 +2051,10 @@ ACMD(refine) refine = cap_value(refine, -MAX_REFINE, MAX_REFINE); count = 0; - for (j = 0; j < EQI_MAX-1; j++) { + for (j = 0; j < EQI_MAX; j++) { if ((i = sd->equip_index[j]) < 0) continue; + if(j == EQI_AMMO) continue; /* can't equip ammo */ if(j == EQI_HAND_R && sd->equip_index[EQI_HAND_L] == i) continue; if(j == EQI_HEAD_MID && sd->equip_index[EQI_HEAD_LOW] == i) diff --git a/src/map/pc.c b/src/map/pc.c index feca11758..64fbd77f3 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -2002,8 +2002,8 @@ int pc_delautobonus(struct map_session_data* sd, struct s_autobonus *autobonus,c if( autobonus[i].bonus_script ) { int j; - ARR_FIND( 0, EQI_MAX-1, j, sd->equip_index[j] >= 0 && sd->status.inventory[sd->equip_index[j]].equip == autobonus[i].pos ); - if( j < EQI_MAX-1 ) + ARR_FIND( 0, EQI_MAX, j, sd->equip_index[j] >= 0 && sd->status.inventory[sd->equip_index[j]].equip == autobonus[i].pos ); + if( j < EQI_MAX ) script->run_autobonus(autobonus[i].bonus_script,sd->bl.id,sd->equip_index[j]); } continue; @@ -2033,8 +2033,8 @@ int pc_exeautobonus(struct map_session_data *sd,struct s_autobonus *autobonus) if( autobonus->other_script ) { int j; - ARR_FIND( 0, EQI_MAX-1, j, sd->equip_index[j] >= 0 && sd->status.inventory[sd->equip_index[j]].equip == autobonus->pos ); - if( j < EQI_MAX-1 ) + ARR_FIND( 0, EQI_MAX, j, sd->equip_index[j] >= 0 && sd->status.inventory[sd->equip_index[j]].equip == autobonus->pos ); + if( j < EQI_MAX ) script->run_autobonus(autobonus->other_script,sd->bl.id,sd->equip_index[j]); } diff --git a/src/map/status.c b/src/map/status.c index 29a1689a1..be004e918 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -2453,10 +2453,11 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { pc->delautobonus(sd,sd->autobonus3,ARRAYLENGTH(sd->autobonus3),true); // Parse equipment. - for(i=0;i<EQI_MAX-1;i++) { + for(i=0;i<EQI_MAX;i++) { status->current_equip_item_index = index = sd->equip_index[i]; //We pass INDEX to status->current_equip_item_index - for EQUIP_SCRIPT (new cards solution) [Lupus] if(index < 0) continue; + if(i == EQI_AMMO) continue;/* ammo has special handler down there */ if(i == EQI_HAND_R && sd->equip_index[EQI_HAND_L] == index) continue; if(i == EQI_HEAD_MID && sd->equip_index[EQI_HEAD_LOW] == index) @@ -2588,10 +2589,11 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { bstatus->def += (refinedef+50)/100; //Parse Cards - for(i=0;i<EQI_MAX-1;i++) { + for(i=0;i<EQI_MAX;i++) { status->current_equip_item_index = index = sd->equip_index[i]; //We pass INDEX to status->current_equip_item_index - for EQUIP_SCRIPT (new cards solution) [Lupus] if(index < 0) continue; + if(i == EQI_AMMO) continue;/* ammo doesn't have cards */ if(i == EQI_HAND_R && sd->equip_index[EQI_HAND_L] == index) continue; if(i == EQI_HEAD_MID && sd->equip_index[EQI_HEAD_LOW] == index) |