From 17f2e6a581ef9e37f01cfd1b98c335a6d5b5ac75 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Fri, 1 Feb 2013 23:06:45 -0200 Subject: Fixed clif.c::clif_parse_NpcSelectMenu SECURE_NPCTIMEOUT is always defined; the check is wrong. Signed-off-by: shennetsind --- src/map/clif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/map') diff --git a/src/map/clif.c b/src/map/clif.c index f8b5119eb..3443c1ae3 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11112,13 +11112,13 @@ void clif_parse_NpcSelectMenu(int fd,struct map_session_data *sd) uint8 select = RFIFOB(fd,6); if( (select > sd->npc_menu && select != 0xff) || select == 0 ) { -#ifdef SECURE_NPCTIMEOUT +#if SECURE_NPCTIMEOUT if( sd->npc_idle_timer != INVALID_TIMER ) { #endif TBL_NPC* nd = map_id2nd(npc_id); ShowWarning("Invalid menu selection on npc %d:'%s' - got %d, valid range is [%d..%d] (player AID:%d, CID:%d, name:'%s')!\n", npc_id, (nd)?nd->name:"invalid npc id", select, 1, sd->npc_menu, sd->bl.id, sd->status.char_id, sd->status.name); clif_GM_kick(NULL,sd); -#ifdef SECURE_NPCTIMEOUT +#if SECURE_NPCTIMEOUT } #endif return; -- cgit v1.2.3-70-g09d2 From d6d49c43b4f742c7aaffd0a102e6019c9adb7438 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sun, 3 Feb 2013 12:49:17 -0200 Subject: Fixed Bug #7046 Updated Safety Wall Renewal behavior, when taking damage higher than the health of the safety wall, excess damage will no longer be passed to the player. http://hercules.ws/board/tracker/issue-7046-safetywall-should-always-block-at-least-one-hit/ Signed-off-by: shennetsind --- src/map/battle.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/map') diff --git a/src/map/battle.c b/src/map/battle.c index 2198b25ec..4505b6a63 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -808,13 +808,12 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag * in RE, SW possesses a lifetime equal to 3 times the caster's health **/ #ifdef RENEWAL + d->dmg_lv = ATK_BLOCK; if ( ( group->val2 - damage) > 0 ) { group->val2 -= damage; - d->dmg_lv = ATK_BLOCK; - return 0; } else - damage -= group->val2; - skill_delunitgroup(group); + skill_delunitgroup(group); + return 0; #else if (--group->val2<=0) skill_delunitgroup(group); -- cgit v1.2.3-70-g09d2 From 5b378058f51019b4b0a07b89d9bf1c16add01281 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sun, 3 Feb 2013 13:10:26 -0200 Subject: Fixed Bug #7048 Items are no longer unequipped when a card within them is blacklisted (e.g. item_unequip.txt), instead the card's effect is nullified. http://hercules.ws/board/tracker/issue-7048-requestreport-regarding/ Signed-off-by: shennetsind --- src/map/clif.c | 1 + src/map/pc.c | 74 +++++++++++++++++++++++++--------------------------------- 2 files changed, 33 insertions(+), 42 deletions(-) (limited to 'src/map') diff --git a/src/map/clif.c b/src/map/clif.c index 3443c1ae3..e04941336 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9358,6 +9358,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) } map_iwall_get(sd); // Updates Walls Info on this Map to Client + status_calc_pc(sd, false);/* some conditions are map-dependent so we must recalculate */ sd->state.changemap = false; } diff --git a/src/map/pc.c b/src/map/pc.c index abfbbcc12..e26191717 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -700,24 +700,24 @@ int pc_setequipindex(struct map_session_data *sd) return 0; } +//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; +// +// //Crafted/made/hatched items. +// if (itemdb_isspecial(item->card[0])) +// return 1; +// +// /* scan for enchant armor gems */ +// if( item->card[MAX_SLOTS - 1] && s < MAX_SLOTS - 1 ) +// s = MAX_SLOTS - 1; +// +// ARR_FIND( 0, s, i, item->card[i] && (data = itemdb_exists(item->card[i])) != NULL && data->flag.no_equip&flag ); +// return( i < s ) ? 0 : 1; +//} -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; - - //Crafted/made/hatched items. - if (itemdb_isspecial(item->card[0])) - return 1; - - /* scan for enchant armor gems */ - if( item->card[MAX_SLOTS - 1] && s < MAX_SLOTS - 1 ) - s = MAX_SLOTS - 1; - - ARR_FIND( 0, s, i, item->card[i] && (data = itemdb_exists(item->card[i])) != NULL && data->flag.no_equip&flag ); - return( i < s ) ? 0 : 1; -} bool pc_isequipped(struct map_session_data *sd, int nameid) { @@ -860,18 +860,18 @@ int pc_isequip(struct map_session_data *sd,int n) #endif if(item->sex != 2 && sd->status.sex != item->sex) return 0; - if(!map_flag_vs(sd->bl.m) && ((item->flag.no_equip&1) || !pc_isAllowedCardOn(sd,item->slot,n,1))) + if(!map_flag_vs(sd->bl.m) && ((item->flag.no_equip&1))) return 0; - if(map[sd->bl.m].flag.pvp && ((item->flag.no_equip&2) || !pc_isAllowedCardOn(sd,item->slot,n,2))) + if(map[sd->bl.m].flag.pvp && ((item->flag.no_equip&2))) return 0; - if(map_flag_gvg(sd->bl.m) && ((item->flag.no_equip&4) || !pc_isAllowedCardOn(sd,item->slot,n,4))) + if(map_flag_gvg(sd->bl.m) && ((item->flag.no_equip&4))) return 0; - if(map[sd->bl.m].flag.battleground && ((item->flag.no_equip&8) || !pc_isAllowedCardOn(sd,item->slot,n,8))) + if(map[sd->bl.m].flag.battleground && ((item->flag.no_equip&8))) return 0; if(map[sd->bl.m].flag.restricted) { int flag =8*map[sd->bl.m].zone; - if (item->flag.no_equip&flag || !pc_isAllowedCardOn(sd,item->slot,n,flag)) + if (item->flag.no_equip&flag) return 0; } @@ -8618,33 +8618,27 @@ int pc_checkitem(struct map_session_data *sd) if( sd->state.vending ) //Avoid reorganizing items when we are vending, as that leads to exploits (pointed out by End of Exam) return 0; - if( battle_config.item_check ) - {// check for invalid(ated) items - for( i = 0; i < MAX_INVENTORY; i++ ) - { + if( battle_config.item_check ) { // check for invalid(ated) items + for( i = 0; i < MAX_INVENTORY; i++ ) { id = sd->status.inventory[i].nameid; - if( id && !itemdb_available(id) ) - { + if( id && !itemdb_available(id) ) { ShowWarning("Removed invalid/disabled item id %d from inventory (amount=%d, char_id=%d).\n", id, sd->status.inventory[i].amount, sd->status.char_id); pc_delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_OTHER); } } - for( i = 0; i < MAX_CART; i++ ) - { + for( i = 0; i < MAX_CART; i++ ) { id = sd->status.cart[i].nameid; - if( id && !itemdb_available(id) ) - { + if( id && !itemdb_available(id) ) { ShowWarning("Removed invalid/disabled item id %d from cart (amount=%d, char_id=%d).\n", id, sd->status.cart[i].amount, sd->status.char_id); pc_cart_delitem(sd, i, sd->status.cart[i].amount, 0, LOG_TYPE_OTHER); } } } - for( i = 0; i < MAX_INVENTORY; i++) - { + for( i = 0; i < MAX_INVENTORY; i++) { it = sd->inventory_data[i]; if( sd->status.inventory[i].nameid == 0 ) @@ -8653,31 +8647,27 @@ int pc_checkitem(struct map_session_data *sd) if( !sd->status.inventory[i].equip ) continue; - if( sd->status.inventory[i].equip&~pc_equippoint(sd,i) ) - { + if( sd->status.inventory[i].equip&~pc_equippoint(sd,i) ) { pc_unequipitem(sd, i, 2); calc_flag = 1; continue; } - if( it ) - { // check for forbiden items. + if( it ) { // check for forbiden items. int flag = (map[sd->bl.m].flag.restricted?(8*map[sd->bl.m].zone):0) | (!map_flag_vs(sd->bl.m)?1:0) | (map[sd->bl.m].flag.pvp?2:0) | (map_flag_gvg(sd->bl.m)?4:0) | (map[sd->bl.m].flag.battleground?8:0); - if( flag && (it->flag.no_equip&flag || !pc_isAllowedCardOn(sd,it->slot,i,flag)) ) - { + if( flag && (it->flag.no_equip&flag) ) { pc_unequipitem(sd, i, 2); calc_flag = 1; } } } - if( calc_flag && sd->state.active ) - { + if( calc_flag && sd->state.active ) { pc_checkallowskill(sd); status_calc_pc(sd,0); } -- cgit v1.2.3-70-g09d2 From 24d6aba263ff25724b8e6c9d6a228bba9fd6e756 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sun, 3 Feb 2013 13:12:57 -0200 Subject: Updating the headers of so-far modified files with outdated headers Signed-off-by: shennetsind --- src/common/core.c | 5 +++-- src/common/sql.c | 5 +++-- src/common/sql.h | 5 +++-- src/map/pc.c | 5 +++-- src/map/skill.c | 5 +++-- src/map/status.c | 5 +++-- 6 files changed, 18 insertions(+), 12 deletions(-) (limited to 'src/map') diff --git a/src/common/core.c b/src/common/core.c index bb536a255..b1714b7a5 100644 --- a/src/common/core.c +++ b/src/common/core.c @@ -1,5 +1,6 @@ -// Copyright (c) Athena Dev Teams - Licensed under GNU GPL -// For more information, see LICENCE in the main folder +// Copyright (c) Hercules dev team, licensed under GNU GPL. +// See the LICENSE file +// Portions Copyright (c) Athena dev team #include "../common/mmo.h" #include "../common/showmsg.h" diff --git a/src/common/sql.c b/src/common/sql.c index 96346d68c..d00b51694 100644 --- a/src/common/sql.c +++ b/src/common/sql.c @@ -1,5 +1,6 @@ -// Copyright (c) Athena Dev Teams - Licensed under GNU GPL -// For more information, see LICENCE in the main folder +// Copyright (c) Hercules dev team, licensed under GNU GPL. +// See the LICENSE file +// Portions Copyright (c) Athena dev team #include "../common/cbasetypes.h" #include "../common/malloc.h" diff --git a/src/common/sql.h b/src/common/sql.h index a9d8c6136..5ac92665e 100644 --- a/src/common/sql.h +++ b/src/common/sql.h @@ -1,5 +1,6 @@ -// Copyright (c) Athena Dev Teams - Licensed under GNU GPL -// For more information, see LICENCE in the main folder +// Copyright (c) Hercules dev team, licensed under GNU GPL. +// See the LICENSE file +// Portions Copyright (c) Athena dev team #ifndef _COMMON_SQL_H_ #define _COMMON_SQL_H_ diff --git a/src/map/pc.c b/src/map/pc.c index e26191717..49b905c0d 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1,5 +1,6 @@ -// Copyright (c) Athena Dev Teams - Licensed under GNU GPL -// For more information, see LICENCE in the main folder +// Copyright (c) Hercules dev team, licensed under GNU GPL. +// See the LICENSE file +// Portions Copyright (c) Athena dev team #include "../common/cbasetypes.h" #include "../common/core.h" // get_svn_revision() diff --git a/src/map/skill.c b/src/map/skill.c index 448f54406..f806c4ec5 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -1,5 +1,6 @@ -// Copyright (c) Athena Dev Teams - Licensed under GNU GPL -// For more information, see LICENCE in the main folder +// Copyright (c) Hercules dev team, licensed under GNU GPL. +// See the LICENSE file +// Portions Copyright (c) Athena dev team #include "../common/cbasetypes.h" #include "../common/timer.h" diff --git a/src/map/status.c b/src/map/status.c index 0379d05d2..8171f20ec 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1,5 +1,6 @@ -// Copyright (c) Athena Dev Teams - Licensed under GNU GPL -// For more information, see LICENCE in the main folder +// Copyright (c) Hercules dev team, licensed under GNU GPL. +// See the LICENSE file +// Portions Copyright (c) Athena dev team #include "../common/cbasetypes.h" #include "../common/timer.h" -- cgit v1.2.3-70-g09d2