summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-03-27 13:22:55 -0300
committershennetsind <ind@henn.et>2013-03-27 13:22:55 -0300
commit90f117f6b071c9c12bb8b521b6de46301639e75c (patch)
treeb9b7c509abe0d7009ab7483a9201f4bcb579bce1 /src/map/pc.c
parentc58f741a0f2b807cbeb065c2dbbfe4f86dfb95b2 (diff)
downloadhercules-90f117f6b071c9c12bb8b521b6de46301639e75c.tar.gz
hercules-90f117f6b071c9c12bb8b521b6de46301639e75c.tar.bz2
hercules-90f117f6b071c9c12bb8b521b6de46301639e75c.tar.xz
hercules-90f117f6b071c9c12bb8b521b6de46301639e75c.zip
Introducing Hercules' Map Zone Database
Click the link for full info~! http://hercules.ws/board/topic/302-introducing-hercules-map-zone-database/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 4bd66a67c..840bf0c03 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4227,12 +4227,13 @@ int pc_isUseitem(struct map_session_data *sd,int n)
int pc_useitem(struct map_session_data *sd,int n)
{
unsigned int tick = gettick();
- int amount, nameid;
+ int amount, nameid, i;
struct script_code *script;
nullpo_ret(sd);
if( sd->npc_id ){
+ /* TODO: add to clif_messages enum */
#ifdef RENEWAL
clif_msg(sd, 0x783); // TODO look for the client date that has this message.
#endif
@@ -4320,19 +4321,15 @@ int pc_useitem(struct map_session_data *sd,int n)
}
}
- /* on restricted maps the item is consumed but the effect is not used */
- if (
- (!map_flag_vs(sd->bl.m) && sd->inventory_data[n]->flag.no_equip&1) || // Normal
- (map[sd->bl.m].flag.pvp && sd->inventory_data[n]->flag.no_equip&2) || // PVP
- (map_flag_gvg(sd->bl.m) && sd->inventory_data[n]->flag.no_equip&4) || // GVG
- (map[sd->bl.m].flag.battleground && sd->inventory_data[n]->flag.no_equip&8) || // Battleground
- (map[sd->bl.m].flag.restricted && sd->inventory_data[n]->flag.no_equip&(8*map[sd->bl.m].zone)) // Zone restriction
- ) {
- if( battle_config.item_restricted_consumption_type ) {
- clif_useitemack(sd,n,sd->status.inventory[n].amount-1,true);
- pc_delitem(sd,n,1,1,0,LOG_TYPE_CONSUME);
+ /* on restricted maps the item is consumed but the effect is not used */
+ for(i = 0; i < map[sd->bl.m].zone->disabled_items_count; i++) {
+ if( map[sd->bl.m].zone->disabled_items[i] == nameid ) {
+ if( battle_config.item_restricted_consumption_type ) {
+ clif_useitemack(sd,n,sd->status.inventory[n].amount-1,true);
+ pc_delitem(sd,n,1,1,0,LOG_TYPE_CONSUME);
+ }
+ return 0;
}
- return 0;/* regardless, effect is not run */
}
sd->itemid = sd->status.inventory[n].nameid;