diff --git a/server/gameserver/constant.h b/server/gameserver/constant.h index 07845570..9c2a38f0 100644 --- a/server/gameserver/constant.h +++ b/server/gameserver/constant.h @@ -575,3 +575,5 @@ const int MAP_BLOCK_START_ID = 1000000000; const int ANDROID_AI_ID_START = 10001; const int MAX_SKILL_LV = 15; + +const int CHECK_SHOT_HOLD_STATE_TIMER_EVENT = a8::TIMER_USER_EVENT + 1; diff --git a/server/gameserver/player.cc b/server/gameserver/player.cc index 62b690d3..7daf3b9b 100644 --- a/server/gameserver/player.cc +++ b/server/gameserver/player.cc @@ -1447,14 +1447,8 @@ void Player::CheckShotHoldState(Weapon* weapon) return; } if (!shot_hold_timer.expired()) { - // 888 - #if 1 - #else - if (weapon->meta->buff_meta->pb->buff_id() != - room->xtimer.MutableParams(shot_hold_timer)->param1.GetInt()) { - room->xtimer.Delete(shot_hold_timer); - } - #endif + a8::Args args({weapon->meta->buff_meta->pb->buff_id()}); + room->xtimer.FireEvent(shot_hold_timer, CHECK_SHOT_HOLD_STATE_TIMER_EVENT, &args); } //second if (shot_hold_timer.expired()) { @@ -1469,6 +1463,10 @@ void Player::CheckShotHoldState(Weapon* weapon) if (dead || !shot_hold) { room->xtimer.Delete(shot_hold_timer); } + } else if (CHECK_SHOT_HOLD_STATE_TIMER_EVENT == event) { + if (args->Get(0) != buff_id) { + room->xtimer.Delete(shot_hold_timer); + } } else if (a8::TIMER_DELETE_EVENT == event) { RemoveBuffById(buff_id); } diff --git a/third_party/a8 b/third_party/a8 index 2964212b..a2c41b1b 160000 --- a/third_party/a8 +++ b/third_party/a8 @@ -1 +1 @@ -Subproject commit 2964212b5f63df4c2da3815b186d58f80815bc3e +Subproject commit a2c41b1b7edff7e31c8d5f33eb9572a423d3c3bb