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_, &xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory) [] (const a8::XParams& param, bool is_destory)
{ {
Buff* buff = (Buff*)param.sender.GetUserData(); if (!is_destory) {
if (buff->owner->IsHuman()) { Buff* buff = (Buff*)param.sender.GetUserData();
#if 0 if (buff->owner->IsHuman()) {
buff->owner->AsHuman()->shot_start = false; buff->owner->AsHuman()->shot_hold = false;
#endif buff->owner->AsHuman()->series_shot_frames = 0;
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_, &buff->xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory) [] (const a8::XParams& param, bool is_destory)
{ {
Buff* buff = (Buff*)param.param2.GetUserData(); if (!is_destory) {
if (buff->remover_timer) { Buff* buff = (Buff*)param.param2.GetUserData();
buff->remover_timer = nullptr; if (buff->remover_timer) {
buff->remover_timer = nullptr;
}
} }
}); });
} }
@ -3004,8 +3006,10 @@ void Creature::AutoSwitchWeapon()
&xtimer_attacher.timer_list_, &xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory) [] (const a8::XParams& param, bool is_destory)
{ {
if (!is_destory) {
Creature* c = (Creature*)param.sender.GetUserData(); Creature* c = (Creature*)param.sender.GetUserData();
c->auto_switch_weapon_timer_ = nullptr; c->auto_switch_weapon_timer_ = nullptr;
}
}); });
} else { } else {
switch_func(param); switch_func(param);
@ -3045,9 +3049,11 @@ void Creature::CheckLoadingBullet()
&xtimer_attacher.timer_list_, &xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory) [] (const a8::XParams& param, bool is_destory)
{ {
Creature* c = (Creature*)param.sender.GetUserData(); if (!is_destory) {
if (c->reload_delay_timer_) { Creature* c = (Creature*)param.sender.GetUserData();
c->reload_delay_timer_ = nullptr; if (c->reload_delay_timer_) {
c->reload_delay_timer_ = nullptr;
}
} }
}); });
} else { } else {
@ -3437,8 +3443,10 @@ void Creature::LockAttackDir(int time)
&xtimer_attacher.timer_list_, &xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory) [] (const a8::XParams& param, bool is_destory)
{ {
Creature* c = (Creature*)param.sender.GetUserData(); if (!is_destory) {
c->DecDisableAttackDirTimes(); Creature* c = (Creature*)param.sender.GetUserData();
c->DecDisableAttackDirTimes();
}
} }
); );
} }

View File

@ -2936,8 +2936,10 @@ void Human::Revive()
&xtimer_attacher.timer_list_, &xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory) [] (const a8::XParams& param, bool is_destory)
{ {
Human* hum = (Human*)param.sender.GetUserData(); if (!is_destory) {
hum->revive_timer = nullptr; Human* hum = (Human*)param.sender.GetUserData();
hum->revive_timer = nullptr;
}
}); });
SyncAroundPlayers(__FILE__, __LINE__, __func__); SyncAroundPlayers(__FILE__, __LINE__, __func__);
} }
@ -3356,8 +3358,10 @@ void Human::ProcUseItemAction()
&xtimer_attacher.timer_list_, &xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory) [] (const a8::XParams& param, bool is_destory)
{ {
Human* hum = (Human*)param.sender.GetUserData(); if (!is_destory) {
hum->pain_killer_timer = nullptr; Human* hum = (Human*)param.sender.GetUserData();
hum->pain_killer_timer = nullptr;
}
}); });
} }
AddHp(item_meta->i->heal()); AddHp(item_meta->i->heal());
@ -3917,8 +3921,10 @@ void Human::StartRefreshViewTimer()
&xtimer_attacher.timer_list_, &xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory) [] (const a8::XParams& param, bool is_destory)
{ {
Human* hum = (Human*)param.sender.GetUserData(); if (!is_destory) {
hum->refresh_view_timer_ = nullptr; 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_, &xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory) [] (const a8::XParams& param, bool is_destory)
{ {
Player* hum = (Player*)param.sender.GetUserData(); if (!is_destory) {
hum->follow_target_timer_ = nullptr; 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_, &xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory) [] (const a8::XParams& param, bool is_destory)
{ {
Human* hum = (Human*)param.sender.GetUserData(); if (!is_destory) {
hum->dead_timer = nullptr; Human* hum = (Human*)param.sender.GetUserData();
hum->dead_timer = nullptr;
}
}); });
} else { } else {
OnDie(); OnDie();

View File

@ -1462,9 +1462,11 @@ void Player::CheckShotHoldState(Weapon* weapon)
&xtimer_attacher.timer_list_, &xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory) [] (const a8::XParams& param, bool is_destory)
{ {
Human* hum = (Human*)param.sender.GetUserData(); if (!is_destory) {
hum->RemoveBuffById(param.param1); Human* hum = (Human*)param.sender.GetUserData();
hum->shot_hold_timer = nullptr; hum->RemoveBuffById(param.param1);
hum->shot_hold_timer = nullptr;
}
}); });
} }
} }
@ -1506,8 +1508,10 @@ void Player::AsyncRequestWatchWar(bool send_rsp_msg)
&xtimer_attacher.timer_list_, &xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory) [] (const a8::XParams& param, bool is_destory)
{ {
Player* hum = (Player*)param.sender.GetUserData(); if (!is_destory) {
hum->watch_war_req_timer_ = nullptr; 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_, &xtimer_attacher_.timer_list_,
[] (const a8::XParams& param, bool is_destory) [] (const a8::XParams& param, bool is_destory)
{ {
Room* room = (Room*)param.sender.GetUserData(); if (!is_destory) {
room->auto_jump_timer_ = nullptr; Room* room = (Room*)param.sender.GetUserData();
room->auto_jump_timer_ = nullptr;
}
}); });
#ifdef DEBUG #ifdef DEBUG
a8::XPrintf("max_run_delay:%d %d\n", {PerfMonitor::Instance()->max_run_delay_time, 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_, &owner->xtimer_attacher.timer_list_,
[] (const a8::XParams& param, bool is_destory) [] (const a8::XParams& param, bool is_destory)
{ {
Skill* skill = (Skill*)param.sender.GetUserData(); if (!is_destory) {
skill->minor_type_ = SMT_NONE; Skill* skill = (Skill*)param.sender.GetUserData();
skill->minor_cd_time_ = 0; skill->minor_type_ = SMT_NONE;
skill->minor_frameno_ = 0; skill->minor_cd_time_ = 0;
skill->minor_cb_ = nullptr; skill->minor_frameno_ = 0;
skill->minor_mode_timer_ = nullptr; skill->minor_cb_ = nullptr;
skill->minor_mode_timer_ = nullptr;
}
} }
); );
if (owner->IsHuman()) { if (owner->IsHuman()) {