Bug Fixes:
- Client stuck while deleting char (bugreport:9101), thank leke - Wrong check at pc_is_same_equip_index() triggers double damage for two-handed weapon (bugreport:9124), thank Myskelz & Anacondaqq - Follow up 3d27b7e, Item avail check for npc_cashshop_buy() (bugreport:9122), thank Napster - Missing enum 'K' for LOG_TYPE_BANK at `zenylog` (bugreport:9122), thank Napster Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
This commit is contained in:
parent
0105bc7191
commit
a8f239fc88
@ -32,7 +32,7 @@ CREATE TABLE IF NOT EXISTS `zenylog` (
|
||||
`time` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`char_id` int(11) NOT NULL default '0',
|
||||
`src_id` int(11) NOT NULL default '0',
|
||||
`type` enum('T','V','P','M','S','N','D','C','A','E','I','B') NOT NULL default 'S',
|
||||
`type` enum('T','V','P','M','S','N','D','C','A','E','I','B','K') NOT NULL default 'S',
|
||||
`amount` int(11) NOT NULL default '0',
|
||||
`map` varchar(11) NOT NULL default '',
|
||||
PRIMARY KEY (`id`),
|
||||
|
1
sql-files/upgrades/upgrade_20140713.sql
Normal file
1
sql-files/upgrades/upgrade_20140713.sql
Normal file
@ -0,0 +1 @@
|
||||
ALTER TABLE `zenylog` CHANGE `type` `type` ENUM('T','V','P','M','S','N','D','C','A','E','I','B','K') NOT NULL DEFAULT 'S';
|
@ -337,6 +337,15 @@ void chclif_char_delete2_ack(int fd, int char_id, uint32 result, time_t delete_d
|
||||
/// Any (0x718): An unknown error has occurred.
|
||||
/// HC: <082a>.W <char id>.L <Msg:0-5>.L
|
||||
void chclif_char_delete2_accept_ack(int fd, int char_id, uint32 result) {
|
||||
if(result == 1 ){
|
||||
struct char_session_data* sd;
|
||||
sd = (struct char_session_data*)session[fd]->session_data;
|
||||
|
||||
if( sd->version >= date2version(20130000) ){
|
||||
chclif_mmo_char_send(fd, sd);
|
||||
}
|
||||
}
|
||||
|
||||
WFIFOHEAD(fd,10);
|
||||
WFIFOW(fd,0) = 0x82a;
|
||||
WFIFOL(fd,2) = char_id;
|
||||
|
@ -1462,12 +1462,14 @@ int npc_cashshop_buy(struct map_session_data *sd, unsigned short nameid, int amo
|
||||
if( (item = itemdb_exists(nameid)) == NULL )
|
||||
return 5; // Invalid Item
|
||||
|
||||
ARR_FIND(0, nd->u.shop.count, i, nd->u.shop.shop_item[i].nameid == nameid);
|
||||
ARR_FIND(0, nd->u.shop.count, i, nd->u.shop.shop_item[i].nameid == nameid || itemdb_viewid(nd->u.shop.shop_item[i].nameid) == nameid);
|
||||
if( i == nd->u.shop.count )
|
||||
return 5;
|
||||
if( nd->u.shop.shop_item[i].value <= 0 )
|
||||
return 5;
|
||||
|
||||
nameid = nd->u.shop.shop_item[i].nameid; //item_avail replacement
|
||||
|
||||
if(!itemdb_isstackable(nameid) && amount > 1)
|
||||
{
|
||||
ShowWarning("Player %s (%d:%d) sent a hexed packet trying to buy %d of nonstackable item %hu!\n",
|
||||
|
12
src/map/pc.c
12
src/map/pc.c
@ -11081,22 +11081,22 @@ short pc_get_itemgroup_bonus_group(struct map_session_data* sd, uint16 group_id)
|
||||
* @return True if item in same inventory index, False if doesn't
|
||||
*/
|
||||
bool pc_is_same_equip_index(enum equip_index eqi, int *equip_index, int8 index) {
|
||||
if (index < 0 || index >= ARRAYLENGTH(equip_index))
|
||||
return false;
|
||||
if (index < 0 || index >= MAX_INVENTORY)
|
||||
return true;
|
||||
// Dual weapon checks
|
||||
if (eqi == EQI_HAND_R && equip_index[EQI_HAND_L] == index)
|
||||
return true;
|
||||
// Headgear with Mid & Low location
|
||||
else if (eqi == EQI_HEAD_MID && equip_index[EQI_HEAD_LOW] == index)
|
||||
if (eqi == EQI_HEAD_MID && equip_index[EQI_HEAD_LOW] == index)
|
||||
return true;
|
||||
// Headgear with Top & Mid or Low location
|
||||
else if (eqi == EQI_HEAD_TOP && (equip_index[EQI_HEAD_MID] == index || equip_index[EQI_HEAD_LOW] == index))
|
||||
if (eqi == EQI_HEAD_TOP && (equip_index[EQI_HEAD_MID] == index || equip_index[EQI_HEAD_LOW] == index))
|
||||
return true;
|
||||
// Headgear with Mid & Low location
|
||||
else if (eqi == EQI_COSTUME_MID && equip_index[EQI_COSTUME_LOW] == index)
|
||||
if (eqi == EQI_COSTUME_MID && equip_index[EQI_COSTUME_LOW] == index)
|
||||
return true;
|
||||
// Headgear with Top & Mid or Low location
|
||||
else if (eqi == EQI_COSTUME_TOP && (equip_index[EQI_COSTUME_MID] == index || equip_index[EQI_COSTUME_LOW] == index))
|
||||
if (eqi == EQI_COSTUME_TOP && (equip_index[EQI_COSTUME_MID] == index || equip_index[EQI_COSTUME_LOW] == index))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
@ -12219,8 +12219,8 @@ struct skill_unit_group* skill_unitsetting (struct block_list *src, uint16 skill
|
||||
/*==========================================
|
||||
*
|
||||
*------------------------------------------*/
|
||||
void ext_skill_unit_onplace(struct skill_unit *src, struct block_list *bl, unsigned int tick){skill_unit_onplace(src, bl, tick);}
|
||||
static int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, unsigned int tick)
|
||||
void ext_skill_unit_onplace(struct skill_unit *unit, struct block_list *bl, unsigned int tick){skill_unit_onplace(unit, bl, tick);}
|
||||
static int skill_unit_onplace (struct skill_unit *unit, struct block_list *bl, unsigned int tick)
|
||||
{
|
||||
struct skill_unit_group *sg;
|
||||
struct block_list *ss;
|
||||
@ -12229,14 +12229,14 @@ static int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, un
|
||||
enum sc_type type;
|
||||
uint16 skill_id;
|
||||
|
||||
nullpo_ret(src);
|
||||
nullpo_ret(unit);
|
||||
nullpo_ret(bl);
|
||||
|
||||
if(bl->prev==NULL || !src->alive || status_isdead(bl))
|
||||
if(bl->prev == NULL || !unit->alive || status_isdead(bl))
|
||||
return 0;
|
||||
|
||||
nullpo_ret(sg=src->group);
|
||||
nullpo_ret(ss=map_id2bl(sg->src_id));
|
||||
nullpo_ret(sg = unit->group);
|
||||
nullpo_ret(ss = map_id2bl(sg->src_id));
|
||||
|
||||
if( (skill_get_type(sg->skill_id) == BF_MAGIC && map_getcell(bl->m, bl->x, bl->y, CELL_CHKLANDPROTECTOR) && sg->skill_id != SA_LANDPROTECTOR) ||
|
||||
map_getcell(bl->m, bl->x, bl->y, CELL_CHKMAELSTROM) )
|
||||
@ -12271,7 +12271,7 @@ static int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, un
|
||||
const struct TimerData* td = sc->data[type]?get_timer(sc->data[type]->timer):NULL;
|
||||
if( td )
|
||||
sec = DIFF_TICK(td->tick, tick);
|
||||
map_moveblock(bl, src->bl.x, src->bl.y, tick);
|
||||
map_moveblock(bl, unit->bl.x, unit->bl.y, tick);
|
||||
clif_fixpos(bl);
|
||||
sg->val2 = bl->id;
|
||||
}
|
||||
@ -12306,7 +12306,7 @@ static int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, un
|
||||
if(bl->type==BL_PC && !working){
|
||||
struct map_session_data *sd = (struct map_session_data *)bl;
|
||||
if((!sd->chatID || battle_config.chat_warpportal)
|
||||
&& sd->ud.to_x == src->bl.x && sd->ud.to_y == src->bl.y)
|
||||
&& sd->ud.to_x == unit->bl.x && sd->ud.to_y == unit->bl.y)
|
||||
{
|
||||
int x = sg->val2>>16;
|
||||
int y = sg->val2&0xffff;
|
||||
@ -12346,12 +12346,12 @@ static int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, un
|
||||
case UNT_SUITON:
|
||||
if(!sce)
|
||||
sc_start4(ss, bl,type,100,sg->skill_lv,
|
||||
map_flag_vs(bl->m) || battle_check_target(&src->bl,bl,BCT_ENEMY)>0?1:0, //Send val3 =1 to reduce agi.
|
||||
map_flag_vs(bl->m) || battle_check_target(&unit->bl,bl,BCT_ENEMY)>0?1:0, //Send val3 =1 to reduce agi.
|
||||
0,0,sg->limit);
|
||||
break;
|
||||
|
||||
case UNT_HERMODE:
|
||||
if (sg->src_id!=bl->id && battle_check_target(&src->bl,bl,BCT_PARTY|BCT_GUILD) > 0)
|
||||
if (sg->src_id!=bl->id && battle_check_target(&unit->bl,bl,BCT_PARTY|BCT_GUILD) > 0)
|
||||
status_change_clear_buffs(bl,1); //Should dispell only allies.
|
||||
case UNT_RICHMANKIM:
|
||||
case UNT_ETERNALCHAOS:
|
||||
@ -12391,7 +12391,7 @@ static int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, un
|
||||
if (!sce)
|
||||
{
|
||||
sc_start4(ss, bl, type, 100, sg->skill_lv, sg->val1, sg->val2, sg->group_id, sg->limit);
|
||||
if (battle_check_target(&src->bl,bl,BCT_ENEMY)>0)
|
||||
if (battle_check_target(&unit->bl,bl,BCT_ENEMY)>0)
|
||||
skill_additional_effect (ss, bl, sg->skill_id, sg->skill_lv, BF_MISC, ATK_DEF, tick);
|
||||
}
|
||||
break;
|
||||
@ -12403,9 +12403,9 @@ static int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, un
|
||||
|
||||
// officially, icewall has no problems existing on occupied cells [ultramage]
|
||||
// case UNT_ICEWALL: //Destroy the cell. [Skotlex]
|
||||
// src->val1 = 0;
|
||||
// if(src->limit + sg->tick > tick + 700)
|
||||
// src->limit = DIFF_TICK(tick+700,sg->tick);
|
||||
// unit->val1 = 0;
|
||||
// if(unit->limit + sg->tick > tick + 700)
|
||||
// unit->limit = DIFF_TICK(tick+700,sg->tick);
|
||||
// break;
|
||||
|
||||
case UNT_MOONLIT:
|
||||
@ -13441,33 +13441,33 @@ static int skill_unit_effect (struct block_list* bl, va_list ap)
|
||||
/*==========================================
|
||||
*
|
||||
*------------------------------------------*/
|
||||
int64 skill_unit_ondamaged (struct skill_unit *src, struct block_list *bl, int64 damage, unsigned int tick)
|
||||
int64 skill_unit_ondamaged (struct skill_unit *unit, struct block_list *bl, int64 damage, unsigned int tick)
|
||||
{
|
||||
struct skill_unit_group *sg;
|
||||
|
||||
nullpo_ret(src);
|
||||
nullpo_ret(sg=src->group);
|
||||
nullpo_ret(unit);
|
||||
nullpo_ret(sg = unit->group);
|
||||
|
||||
switch( sg->unit_id ) {
|
||||
case UNT_BLASTMINE:
|
||||
case UNT_SKIDTRAP:
|
||||
case UNT_LANDMINE:
|
||||
case UNT_SHOCKWAVE:
|
||||
case UNT_SANDMAN:
|
||||
case UNT_FLASHER:
|
||||
case UNT_CLAYMORETRAP:
|
||||
case UNT_FREEZINGTRAP:
|
||||
case UNT_TALKIEBOX:
|
||||
case UNT_ANKLESNARE:
|
||||
case UNT_ICEWALL:
|
||||
case UNT_REVERBERATION:
|
||||
case UNT_WALLOFTHORN:
|
||||
case UNT_NETHERWORLD:
|
||||
src->val1-=(int)cap_value(damage,INT_MIN,INT_MAX);
|
||||
break;
|
||||
default:
|
||||
damage = 0;
|
||||
break;
|
||||
case UNT_BLASTMINE:
|
||||
case UNT_SKIDTRAP:
|
||||
case UNT_LANDMINE:
|
||||
case UNT_SHOCKWAVE:
|
||||
case UNT_SANDMAN:
|
||||
case UNT_FLASHER:
|
||||
case UNT_CLAYMORETRAP:
|
||||
case UNT_FREEZINGTRAP:
|
||||
case UNT_TALKIEBOX:
|
||||
case UNT_ANKLESNARE:
|
||||
case UNT_ICEWALL:
|
||||
case UNT_REVERBERATION:
|
||||
case UNT_WALLOFTHORN:
|
||||
case UNT_NETHERWORLD:
|
||||
unit->val1 -= (int)cap_value(damage,INT_MIN,INT_MAX);
|
||||
break;
|
||||
default:
|
||||
damage = 0;
|
||||
break;
|
||||
}
|
||||
return damage;
|
||||
}
|
||||
|
@ -370,7 +370,7 @@ int skill_blown(struct block_list* src, struct block_list* target, int count, in
|
||||
int skill_break_equip(struct block_list *src,struct block_list *bl, unsigned short where, int rate, int flag);
|
||||
int skill_strip_equip(struct block_list *src,struct block_list *bl, unsigned short where, int rate, int lv, int time);
|
||||
// Skills unit
|
||||
struct skill_unit_group* skill_id2group(int group_id);
|
||||
struct skill_unit_group *skill_id2group(int group_id);
|
||||
struct skill_unit_group *skill_unitsetting(struct block_list* src, uint16 skill_id, uint16 skill_lv, short x, short y, int flag);
|
||||
struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int x, int y, int val1, int val2);
|
||||
int skill_delunit(struct skill_unit *unit);
|
||||
@ -379,8 +379,8 @@ int skill_delunitgroup_(struct skill_unit_group *group, const char* file, int li
|
||||
#define skill_delunitgroup(group) skill_delunitgroup_(group,__FILE__,__LINE__,__func__)
|
||||
int skill_clear_unitgroup(struct block_list *src);
|
||||
int skill_clear_group(struct block_list *bl, int flag);
|
||||
void ext_skill_unit_onplace(struct skill_unit *src, struct block_list *bl, unsigned int tick);
|
||||
int64 skill_unit_ondamaged(struct skill_unit *src,struct block_list *bl,int64 damage,unsigned int tick);
|
||||
void ext_skill_unit_onplace(struct skill_unit *unit, struct block_list *bl, unsigned int tick);
|
||||
int64 skill_unit_ondamaged(struct skill_unit *unit,struct block_list *bl,int64 damage,unsigned int tick);
|
||||
|
||||
int skill_castfix( struct block_list *bl, uint16 skill_id, uint16 skill_lv);
|
||||
int skill_castfix_sc( struct block_list *bl, int time);
|
||||
|
@ -1354,6 +1354,8 @@ int status_damage(struct block_list *src,struct block_list *target,int64 dhp, in
|
||||
int hp = (int)cap_value(dhp,INT_MIN,INT_MAX);
|
||||
int sp = (int)cap_value(dsp,INT_MIN,INT_MAX);
|
||||
|
||||
nullpo_ret(target);
|
||||
|
||||
if(sp && !(target->type&BL_CONSUME))
|
||||
sp = 0; // Not a valid SP target.
|
||||
|
||||
@ -1371,7 +1373,7 @@ int status_damage(struct block_list *src,struct block_list *target,int64 dhp, in
|
||||
return (int)skill_unit_ondamaged((struct skill_unit *)target, src, hp, gettick());
|
||||
|
||||
status = status_get_status_data(target);
|
||||
if( status == &dummy_status )
|
||||
if(!status || status == &dummy_status )
|
||||
return 0;
|
||||
|
||||
if ((unsigned int)hp >= status->hp) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user