修复宕机bug删除a8::TIMER_DELETE_EVENT

This commit is contained in:
aozhiwei 2024-05-28 17:21:16 +08:00
parent 334dd641e0
commit 7aed70e9ce
7 changed files with 12 additions and 16 deletions

View File

@ -17,11 +17,6 @@ void AutoShotBuff::Activate()
owner->AsHuman()->shot_hold = true;
owner->AsHuman()->series_shot_frames = 0;
}
} else if (a8::TIMER_DELETE_EVENT == event) {
if (owner->IsHuman()) {
owner->AsHuman()->shot_hold = false;
owner->AsHuman()->series_shot_frames = 0;
}
}
},
&xtimer_attacher);
@ -29,5 +24,8 @@ void AutoShotBuff::Activate()
void AutoShotBuff::Deactivate()
{
if (owner->IsHuman()) {
owner->AsHuman()->shot_hold = false;
owner->AsHuman()->series_shot_frames = 0;
}
}

View File

@ -1104,7 +1104,7 @@ void CallFuncBuff::SummonCarSpecPoint()
[room = owner->room, car_id, x, y, z, special_operators]
(int event, const a8::Args* args) mutable
{
if (a8::TIMER_DELETE_EVENT == event) {
if (a8::TIMER_EXEC_EVENT == event) {
if (!room->IsGameOver()) {
const mt::Equip* equip_meta = mt::Equip::GetById(car_id);
if (equip_meta && equip_meta->equip_type() == EQUIP_TYPE_CAR) {

View File

@ -437,7 +437,7 @@ void Bullet::ProcSmokeBomb()
(SERVER_FRAME_RATE * mt::Param::GetIntParam("smoke_duration", 10),
[task] (int event, const a8::Args* args)
{
if (a8::TIMER_DELETE_EVENT == event) {
if (a8::TIMER_EXEC_EVENT == event) {
task->Done();
}
},

View File

@ -481,9 +481,6 @@ a8::XTimerWp Creature::TryDelayAddBuff(Creature* caster,
handle->post_add_cb(this, buff_uniid);
}
}
} else if (a8::TIMER_DELETE_EVENT == event) {
if (handle) {
}
}
},
&xtimer_attacher);
@ -2867,7 +2864,6 @@ void Creature::LockAttackDir(int time)
[this] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
} else if (a8::TIMER_DELETE_EVENT == event){
DecDisableAttackDirTimes();
}
},
@ -3730,8 +3726,7 @@ void Creature::AddIgnoreTarget(int target_uniid, int time)
(SERVER_FRAME_RATE * time,
[this, target_uniid] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event ||
a8::TIMER_DELETE_EVENT == event) {
if (a8::TIMER_EXEC_EVENT == event) {
ignore_target_hash_.erase(target_uniid);
}
},
@ -3743,6 +3738,7 @@ void Creature::DelIgnoreTarget(int target_uniid)
auto itr = ignore_target_hash_.find(target_uniid);
if (itr != ignore_target_hash_.end()) {
room->xtimer.Delete(itr->second);
ignore_target_hash_.erase(itr);
}
}

View File

@ -1507,7 +1507,7 @@ void Human::ProcThrowDmg(int throw_uniid)
(SERVER_FRAME_RATE * mt::Param::GetIntParam("smoke_duration", 10),
[task] (int event, const a8::Args* args)
{
if (a8::TIMER_DELETE_EVENT == event) {
if (a8::TIMER_EXEC_EVENT == event) {
task->Done();
}
},
@ -2945,7 +2945,7 @@ int Creature::Throw(const mt::Equip* src_equip_meta,
SERVER_FRAME_RATE * 15,
[this, throw_uniid] (int event, const a8::Args* args)
{
if (a8::TIMER_DELETE_EVENT == event) {
if (a8::TIMER_EXEC_EVENT == event) {
if (IsPlayer()) {
AsPlayer()->ProcThrowDmg(throw_uniid);
}

View File

@ -25,6 +25,7 @@ private:
long long e_wptr_num = 0;
long long event_handler_num = 0;
int traversing_cell_creature_count = 0;
long long find_path_max_time = 0;
private:
void Output();

View File

@ -2273,6 +2273,7 @@ void Room::RandRemoveAndroid()
});
}
if (hum) {
hum->CheckSpecObject(0);
if (hum->team_id != 0) {
Team* team = GetTeam(hum->team_id);
if (team) {