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,14 +758,13 @@ 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)
{ {
if (!is_destory) {
Buff* buff = (Buff*)param.sender.GetUserData(); Buff* buff = (Buff*)param.sender.GetUserData();
if (buff->owner->IsHuman()) { if (buff->owner->IsHuman()) {
#if 0
buff->owner->AsHuman()->shot_start = false;
#endif
buff->owner->AsHuman()->shot_hold = false; buff->owner->AsHuman()->shot_hold = false;
buff->owner->AsHuman()->series_shot_frames = 0; buff->owner->AsHuman()->series_shot_frames = 0;
} }
}
}); });
} }

View File

@ -213,10 +213,12 @@ 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)
{ {
if (!is_destory) {
Buff* buff = (Buff*)param.param2.GetUserData(); Buff* buff = (Buff*)param.param2.GetUserData();
if (buff->remover_timer) { if (buff->remover_timer) {
buff->remover_timer = nullptr; buff->remover_timer = nullptr;
} }
}
}); });
} }
GetTrigger()->ActiveBuff(buff->meta); GetTrigger()->ActiveBuff(buff->meta);
@ -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,10 +3049,12 @@ 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)
{ {
if (!is_destory) {
Creature* c = (Creature*)param.sender.GetUserData(); Creature* c = (Creature*)param.sender.GetUserData();
if (c->reload_delay_timer_) { if (c->reload_delay_timer_) {
c->reload_delay_timer_ = nullptr; c->reload_delay_timer_ = nullptr;
} }
}
}); });
} else { } else {
#ifdef DEBUG #ifdef DEBUG
@ -3437,9 +3443,11 @@ 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)
{ {
if (!is_destory) {
Creature* c = (Creature*)param.sender.GetUserData(); Creature* c = (Creature*)param.sender.GetUserData();
c->DecDisableAttackDirTimes(); 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)
{ {
if (!is_destory) {
Human* hum = (Human*)param.sender.GetUserData(); Human* hum = (Human*)param.sender.GetUserData();
hum->revive_timer = nullptr; 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)
{ {
if (!is_destory) {
Human* hum = (Human*)param.sender.GetUserData(); Human* hum = (Human*)param.sender.GetUserData();
hum->pain_killer_timer = nullptr; 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)
{ {
if (!is_destory) {
Human* hum = (Human*)param.sender.GetUserData(); Human* hum = (Human*)param.sender.GetUserData();
hum->refresh_view_timer_ = nullptr; 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)
{ {
if (!is_destory) {
Player* hum = (Player*)param.sender.GetUserData(); Player* hum = (Player*)param.sender.GetUserData();
hum->follow_target_timer_ = nullptr; 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)
{ {
if (!is_destory) {
Human* hum = (Human*)param.sender.GetUserData(); Human* hum = (Human*)param.sender.GetUserData();
hum->dead_timer = nullptr; 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)
{ {
if (!is_destory) {
Human* hum = (Human*)param.sender.GetUserData(); Human* hum = (Human*)param.sender.GetUserData();
hum->RemoveBuffById(param.param1); hum->RemoveBuffById(param.param1);
hum->shot_hold_timer = nullptr; 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)
{ {
if (!is_destory) {
Player* hum = (Player*)param.sender.GetUserData(); Player* hum = (Player*)param.sender.GetUserData();
hum->watch_war_req_timer_ = nullptr; 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)
{ {
if (!is_destory) {
Room* room = (Room*)param.sender.GetUserData(); Room* room = (Room*)param.sender.GetUserData();
room->auto_jump_timer_ = nullptr; 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,6 +196,7 @@ 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)
{ {
if (!is_destory) {
Skill* skill = (Skill*)param.sender.GetUserData(); Skill* skill = (Skill*)param.sender.GetUserData();
skill->minor_type_ = SMT_NONE; skill->minor_type_ = SMT_NONE;
skill->minor_cd_time_ = 0; skill->minor_cd_time_ = 0;
@ -203,6 +204,7 @@ void Skill::AddMinorMode(
skill->minor_cb_ = nullptr; skill->minor_cb_ = nullptr;
skill->minor_mode_timer_ = nullptr; skill->minor_mode_timer_ = nullptr;
} }
}
); );
if (owner->IsHuman()) { if (owner->IsHuman()) {
Human* hum = owner->AsHuman(); Human* hum = owner->AsHuman();