add is_destory 11

This commit is contained in:
aozhiwei 2022-11-24 13:51:50 +08:00
parent a8e18e1ff1
commit 98b1d110ff
6 changed files with 63 additions and 38 deletions

View File

@ -758,13 +758,12 @@ void Buff::ProcAutoShot()
&xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory)
{
Buff* buff = (Buff*)param.sender.GetUserData();
if (buff->owner->IsHuman()) {
#if 0
buff->owner->AsHuman()->shot_start = false;
#endif
buff->owner->AsHuman()->shot_hold = false;
buff->owner->AsHuman()->series_shot_frames = 0;
if (!is_destory) {
Buff* buff = (Buff*)param.sender.GetUserData();
if (buff->owner->IsHuman()) {
buff->owner->AsHuman()->shot_hold = false;
buff->owner->AsHuman()->series_shot_frames = 0;
}
}
});
}

View File

@ -213,9 +213,11 @@ int Creature::AddBuff(Creature* caster,
&buff->xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory)
{
Buff* buff = (Buff*)param.param2.GetUserData();
if (buff->remover_timer) {
buff->remover_timer = nullptr;
if (!is_destory) {
Buff* buff = (Buff*)param.param2.GetUserData();
if (buff->remover_timer) {
buff->remover_timer = nullptr;
}
}
});
}
@ -3004,8 +3006,10 @@ void Creature::AutoSwitchWeapon()
&xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory)
{
if (!is_destory) {
Creature* c = (Creature*)param.sender.GetUserData();
c->auto_switch_weapon_timer_ = nullptr;
}
});
} else {
switch_func(param);
@ -3045,9 +3049,11 @@ void Creature::CheckLoadingBullet()
&xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory)
{
Creature* c = (Creature*)param.sender.GetUserData();
if (c->reload_delay_timer_) {
c->reload_delay_timer_ = nullptr;
if (!is_destory) {
Creature* c = (Creature*)param.sender.GetUserData();
if (c->reload_delay_timer_) {
c->reload_delay_timer_ = nullptr;
}
}
});
} else {
@ -3437,8 +3443,10 @@ void Creature::LockAttackDir(int time)
&xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory)
{
Creature* c = (Creature*)param.sender.GetUserData();
c->DecDisableAttackDirTimes();
if (!is_destory) {
Creature* c = (Creature*)param.sender.GetUserData();
c->DecDisableAttackDirTimes();
}
}
);
}

View File

@ -2936,8 +2936,10 @@ void Human::Revive()
&xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory)
{
Human* hum = (Human*)param.sender.GetUserData();
hum->revive_timer = nullptr;
if (!is_destory) {
Human* hum = (Human*)param.sender.GetUserData();
hum->revive_timer = nullptr;
}
});
SyncAroundPlayers(__FILE__, __LINE__, __func__);
}
@ -3356,8 +3358,10 @@ void Human::ProcUseItemAction()
&xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory)
{
Human* hum = (Human*)param.sender.GetUserData();
hum->pain_killer_timer = nullptr;
if (!is_destory) {
Human* hum = (Human*)param.sender.GetUserData();
hum->pain_killer_timer = nullptr;
}
});
}
AddHp(item_meta->i->heal());
@ -3917,8 +3921,10 @@ void Human::StartRefreshViewTimer()
&xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory)
{
Human* hum = (Human*)param.sender.GetUserData();
hum->refresh_view_timer_ = nullptr;
if (!is_destory) {
Human* hum = (Human*)param.sender.GetUserData();
hum->refresh_view_timer_ = nullptr;
}
});
}
@ -4524,8 +4530,10 @@ void Human::DoFollow(int target_id)
&xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory)
{
Player* hum = (Player*)param.sender.GetUserData();
hum->follow_target_timer_ = nullptr;
if (!is_destory) {
Player* hum = (Player*)param.sender.GetUserData();
hum->follow_target_timer_ = nullptr;
}
});
}
}
@ -4652,8 +4660,10 @@ void Human::InternalBeKill(int killer_id, const std::string& killer_name, int we
&xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory)
{
Human* hum = (Human*)param.sender.GetUserData();
hum->dead_timer = nullptr;
if (!is_destory) {
Human* hum = (Human*)param.sender.GetUserData();
hum->dead_timer = nullptr;
}
});
} else {
OnDie();

View File

@ -1462,9 +1462,11 @@ void Player::CheckShotHoldState(Weapon* weapon)
&xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory)
{
Human* hum = (Human*)param.sender.GetUserData();
hum->RemoveBuffById(param.param1);
hum->shot_hold_timer = nullptr;
if (!is_destory) {
Human* hum = (Human*)param.sender.GetUserData();
hum->RemoveBuffById(param.param1);
hum->shot_hold_timer = nullptr;
}
});
}
}
@ -1506,8 +1508,10 @@ void Player::AsyncRequestWatchWar(bool send_rsp_msg)
&xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory)
{
Player* hum = (Player*)param.sender.GetUserData();
hum->watch_war_req_timer_ = nullptr;
if (!is_destory) {
Player* hum = (Player*)param.sender.GetUserData();
hum->watch_war_req_timer_ = nullptr;
}
});
}

View File

@ -1357,8 +1357,10 @@ void Room::UpdateGasInactivePvp()
&xtimer_attacher_.timer_list_,
[] (const a8::XParams& param, bool is_destory)
{
Room* room = (Room*)param.sender.GetUserData();
room->auto_jump_timer_ = nullptr;
if (!is_destory) {
Room* room = (Room*)param.sender.GetUserData();
room->auto_jump_timer_ = nullptr;
}
});
#ifdef DEBUG
a8::XPrintf("max_run_delay:%d %d\n", {PerfMonitor::Instance()->max_run_delay_time,

View File

@ -196,12 +196,14 @@ void Skill::AddMinorMode(
&owner->xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory)
{
Skill* skill = (Skill*)param.sender.GetUserData();
skill->minor_type_ = SMT_NONE;
skill->minor_cd_time_ = 0;
skill->minor_frameno_ = 0;
skill->minor_cb_ = nullptr;
skill->minor_mode_timer_ = nullptr;
if (!is_destory) {
Skill* skill = (Skill*)param.sender.GetUserData();
skill->minor_type_ = SMT_NONE;
skill->minor_cd_time_ = 0;
skill->minor_frameno_ = 0;
skill->minor_cb_ = nullptr;
skill->minor_mode_timer_ = nullptr;
}
}
);
if (owner->IsHuman()) {