summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-18 16:01:26 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-18 16:01:26 +0000
commit2449d2a6e7ddd1648d2e1fe446c97fe94378af28 (patch)
treece6f82d036029d2954764b2fc7119f538e0347fa /src/map/pc.c
parentbb0bd9d290f6dd1f3a455da7d4cd4ae58e8e49a2 (diff)
downloadhercules-2449d2a6e7ddd1648d2e1fe446c97fe94378af28.tar.gz
hercules-2449d2a6e7ddd1648d2e1fe446c97fe94378af28.tar.bz2
hercules-2449d2a6e7ddd1648d2e1fe446c97fe94378af28.tar.xz
hercules-2449d2a6e7ddd1648d2e1fe446c97fe94378af28.zip
- Removed message 592 from trade.c
- Removed mapflag nopvp - Added support for disabling mapflags on a mapflag line: comodo.gat mapflag nomemo <- turns on nomemo mapflag comodo.gat mapflag nomemo off <- turns off nomemo mapflag - Cleaned up and optimized the restricted/zones mapflag. Restricted cards will just not work in disallowed maps rather than blocking the compounded equipement from being used. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6159 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c51
1 files changed, 29 insertions, 22 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 03db5bd9c..b9b532ea1 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -519,7 +519,7 @@ int pc_setequipindex(struct map_session_data *sd)
return 0;
}
-int pc_isAllowedCardOn(struct map_session_data *sd,int s,int eqindex,int flag) {
+static int pc_isAllowedCardOn(struct map_session_data *sd,int s,int eqindex,int flag) {
int i;
struct item *item = &sd->status.inventory[eqindex];
struct item_data *data;
@@ -558,11 +558,11 @@ int pc_isequip(struct map_session_data *sd,int n)
return 0;
if(item->sex != 2 && sd->status.sex != item->sex)
return 0;
- if(map[sd->bl.m].flag.pvp && (item->flag.no_equip&1 || !pc_isAllowedCardOn(sd,item->slot,n,1))) //optimized by Lupus
+ if(map[sd->bl.m].flag.pvp && item->flag.no_equip&1)
return 0;
- if(map_flag_gvg(sd->bl.m) && (item->flag.no_equip&2 || !pc_isAllowedCardOn(sd,item->slot,n,2))) //optimized by Lupus
+ if(map_flag_gvg(sd->bl.m) && item->flag.no_equip&2)
return 0;
- if(map[sd->bl.m].zone && map[sd->bl.m].flag.restricted && (item->flag.no_equip&map[sd->bl.m].zone || !pc_isAllowedCardOn(sd,item->slot,n,map[sd->bl.m].zone)))
+ if(map[sd->bl.m].flag.restricted && item->flag.no_equip&map[sd->bl.m].zone)
return 0;
if (sd->sc.count) {
@@ -2592,8 +2592,7 @@ int pc_isUseitem(struct map_session_data *sd,int n)
if (
(map[sd->bl.m].flag.pvp && item->flag.no_equip&1) || // PVP
(map_flag_gvg(sd->bl.m) && item->flag.no_equip&2) || // GVG
- (map[sd->bl.m].zone && map[sd->bl.m].flag.restricted &&
- item->flag.no_equip&map[sd->bl.m].zone) // Zone restriction
+ (map[sd->bl.m].flag.restricted && item->flag.no_equip&map[sd->bl.m].zone) // Zone restriction
)
return 0;
@@ -6400,23 +6399,31 @@ int pc_checkitem(struct map_session_data *sd)
calc_flag = 1;
}
//?備制限チェック
- if(sd->status.inventory[i].equip && (map[sd->bl.m].flag.pvp||map[sd->bl.m].flag.gvg) &&
- (it->flag.no_equip&1 || !pc_isAllowedCardOn(sd,it->slot,i,1)))
- { //PVP check for forbiden items. optimized by [Lupus]
- sd->status.inventory[i].equip=0;
- calc_flag = 1;
- } else if(sd->status.inventory[i].equip && map_flag_gvg(sd->bl.m) &&
- (it->flag.no_equip&2 || !pc_isAllowedCardOn(sd,it->slot,i,2)))
- { //GvG optimized by [Lupus]
- sd->status.inventory[i].equip=0;
- calc_flag = 1;
- } else if(sd->status.inventory[i].equip && (map[sd->bl.m].zone) && (map[sd->bl.m].flag.restricted) &&
- (it->flag.no_equip&map[sd->bl.m].zone))
- { // Restricted zone by [Komurka]
- sd->status.inventory[i].equip=0;
- calc_flag = 1;
+ if(sd->status.inventory[i].equip && it) {
+ if (map[sd->bl.m].flag.pvp && it->flag.no_equip&1)
+ { //PVP check for forbiden items. optimized by [Lupus]
+ sd->status.inventory[i].equip=0;
+ calc_flag = 1;
+ } else
+ if (map_flag_gvg(sd->bl.m) && it->flag.no_equip&2)
+ { //GvG optimized by [Lupus]
+ sd->status.inventory[i].equip=0;
+ calc_flag = 1;
+ } else
+ if(map[sd->bl.m].flag.restricted && it->flag.no_equip&map[sd->bl.m].zone)
+ { // Restricted zone by [Komurka]
+ sd->status.inventory[i].equip=0;
+ calc_flag = 1;
+ }
+ if (!calc_flag) { //Check cards
+ int flag;
+ flag = (map[sd->bl.m].flag.restricted?map[sd->bl.m].zone:0)
+ | (map[sd->bl.m].flag.pvp?1:0)
+ | (map_flag_gvg(sd->bl.m)?2:0);
+ if (flag && !pc_isAllowedCardOn(sd,it->slot,i,flag))
+ calc_flag = 1;
+ }
}
-
}
pc_setequipindex(sd);