diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-03-06 19:43:37 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-03-06 19:43:37 +0000 |
commit | 2462d4ff90d5444883f4981f0229e223fbf80057 (patch) | |
tree | ed33cf22bd40e772038570e7a27a709cafa0906d /src/map | |
parent | 98e5e5302359c893d4889788c612116bda3efc0f (diff) | |
download | hercules-2462d4ff90d5444883f4981f0229e223fbf80057.tar.gz hercules-2462d4ff90d5444883f4981f0229e223fbf80057.tar.bz2 hercules-2462d4ff90d5444883f4981f0229e223fbf80057.tar.xz hercules-2462d4ff90d5444883f4981f0229e223fbf80057.zip |
- Corrected pc_checkitem not behaving correctly when you had more than one equip with a restricted card.
- Fixed non-chatroom owners being able to kick others from the chatroom.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12310 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/chat.c | 2 | ||||
-rw-r--r-- | src/map/pc.c | 40 |
2 files changed, 15 insertions, 27 deletions
diff --git a/src/map/chat.c b/src/map/chat.c index a01356205..19f265b27 100644 --- a/src/map/chat.c +++ b/src/map/chat.c @@ -273,7 +273,7 @@ int chat_kickchat(struct map_session_data* sd, const char* kickusername) cd = (struct chat_data *)map_id2bl(sd->chatID); - if( !cd ) + if( cd==NULL || (struct block_list *)sd != cd->owner ) return -1; ARR_FIND( 0, cd->users, i, strncmp(cd->usersd[i]->status.name, kickusername, NAME_LENGTH) == 0 ); diff --git a/src/map/pc.c b/src/map/pc.c index 1a88acf02..b0d6cf5b2 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -6564,37 +6564,25 @@ int pc_checkitem(struct map_session_data *sd) if(sd->status.inventory[i].nameid==0) continue; - if(sd->status.inventory[i].equip & ~pc_equippoint(sd,i)) { + + if(!sd->status.inventory[i].equip) + continue; + + if (sd->status.inventory[i].equip&~pc_equippoint(sd,i)) { sd->status.inventory[i].equip=0; calc_flag = 1; + continue; } - //?備制限チェック - 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) + if(it) { + //check for forbiden items. + int 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)) - { - sd->status.inventory[i].equip=0; - calc_flag = 1; - } + if (flag && (it->flag.no_equip&flag || !pc_isAllowedCardOn(sd,it->slot,i,flag))) + { + sd->status.inventory[i].equip=0; + calc_flag = 1; } } } |