summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c3
-rw-r--r--src/map/battle.c4
-rw-r--r--src/map/pc.c8
-rw-r--r--src/map/status.c6
4 files changed, 13 insertions, 8 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/battle.c b/src/map/battle.c
index d65bb910f..38b516bd9 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -6066,9 +6066,11 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
}
if( flag&(BCT_PARTY|BCT_ENEMY) ) {
int s_party = status->get_party_id(s_bl);
+ int s_guild = status->get_guild_id(s_bl);
+
if( s_party && s_party == status->get_party_id(t_bl)
&& !(map->list[m].flag.pvp && map->list[m].flag.pvp_noparty)
- && !(map_flag_gvg(m) && map->list[m].flag.gvg_noparty)
+ && !(map_flag_gvg(m) && map->list[m].flag.gvg_noparty && !( s_guild && s_guild == status->get_guild_id(t_bl) ))
&& (!map->list[m].flag.battleground || sbg_id == tbg_id) )
state |= BCT_PARTY;
else
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)