This commit is contained in:
aozhiwei 2023-03-10 18:07:58 +08:00
parent cb5587340c
commit f87e733b56
4 changed files with 35 additions and 33 deletions

View File

@ -15,7 +15,7 @@ set(LIB_DIR "ubuntu20.04_g++-9")
message(LIB_DIR: ${LIB_DIR} ) message(LIB_DIR: ${LIB_DIR} )
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -std=gnu++1z -DGAME_ID=${GAME_ID} -DNDEBUG -DMAP3D -DDT_VIRTUAL_QUERYFILTER -DNEW_WEAPON_SYS=1") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -std=gnu++1z -DGAME_ID=${GAME_ID} -DNDEBUG -DMAP3D -DDT_VIRTUAL_QUERYFILTER -DNEW_WEAPON_SYS=1")
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++1z -DGAME_ID=${GAME_ID} -DDEBUG -DCXY -DSXY -DMAP3D -DDT_VIRTUAL_QUERYFILTER -DNEW_WEAPON_SYS=1") set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++1z -DGAME_ID=${GAME_ID} -DDEBUG -DCXY -DSXY -DMAP3D -DDT_VIRTUAL_QUERYFILTER -DNEW_WEAPON_SYS=1 -fsanitize=address -fno-omit-frame-pointer")
include_directories( include_directories(
AFTER AFTER

View File

@ -3498,7 +3498,7 @@ void Human::SyncVolume(int slot_id)
[this, i] (int event, const a8::Args* args) [this, i] (int event, const a8::Args* args)
{ {
if (a8::TIMER_EXEC_EVENT == event) { if (a8::TIMER_EXEC_EVENT == event) {
room->frame_event.AddPropChgEx(GetWeakPtrRef(), kPropVolume, i, GetInventory(i), 0, volume_[i], true); room->frame_event.AddPropChgEx(GetWeakPtrRef(), kPropVolume, i, GetInventory(i), volume_[i], 0, true);
} }
}, },
&xtimer_attacher); &xtimer_attacher);

View File

@ -1446,29 +1446,31 @@ void Player::ProcPreSettlementInfo(const std::string& pre_settlement_info)
void Player::UpdateAiming() void Player::UpdateAiming()
{ {
if (aiming) { if (aiming) {
if (aiming_frameno == 0) { if (!HasBuffEffect(kBET_HoldShield)) {
aiming_frameno = room->GetFrameNo(); if (aiming_frameno == 0) {
power_idx = -1; aiming_frameno = room->GetFrameNo();
} power_idx = -1;
if (HasBuffEffect(kBET_Camouflage) && camouflage_aiming_addition_ <= 0) { }
RemoveBuffByEffectId(kBET_Camouflage); if (HasBuffEffect(kBET_Camouflage) && camouflage_aiming_addition_ <= 0) {
} RemoveBuffByEffectId(kBET_Camouflage);
Weapon* p_weapon = GetCurrWeapon(); }
if (second_weapon.meta) { Weapon* p_weapon = GetCurrWeapon();
p_weapon = &second_weapon; if (second_weapon.meta) {
} p_weapon = &second_weapon;
if (!p_weapon->meta->_power_charge.empty()) { }
if (power_idx + 1 > p_weapon->meta->_power_charge.size()) { if (!p_weapon->meta->_power_charge.empty()) {
A8_ABORT(); if (power_idx + 1 > p_weapon->meta->_power_charge.size()) {
} else if (power_idx + 1 == p_weapon->meta->_power_charge.size()) { A8_ABORT();
} else { } else if (power_idx + 1 == p_weapon->meta->_power_charge.size()) {
long long passed_time = (room->GetFrameNo() - aiming_frameno) * FRAME_RATE_MS; } else {
if (passed_time >= std::get<0>(p_weapon->meta->_power_charge[power_idx + 1])) { long long passed_time = (room->GetFrameNo() - aiming_frameno) * FRAME_RATE_MS;
++power_idx; if (passed_time >= std::get<0>(p_weapon->meta->_power_charge[power_idx + 1])) {
ClearAimingBuffs(); ++power_idx;
int buff_id = std::get<2>(p_weapon->meta->_power_charge[power_idx]); ClearAimingBuffs();
MustBeAddBuff(this, buff_id); int buff_id = std::get<2>(p_weapon->meta->_power_charge[power_idx]);
aiming_buffs.push_back(buff_id); MustBeAddBuff(this, buff_id);
aiming_buffs.push_back(buff_id);
}
} }
} }
} }

View File

@ -182,14 +182,6 @@ void Skill::AddMinorMode(
[this] (int event, const a8::Args* args) [this] (int event, const a8::Args* args)
{ {
if (a8::TIMER_EXEC_EVENT == event) { if (a8::TIMER_EXEC_EVENT == event) {
} else if (a8::TIMER_DELETE_EVENT == event) {
minor_type_ = SMT_NONE;
minor_cd_time_ = 0;
minor_frameno_ = 0;
if (minor_cb_) {
minor_cb_(0);
}
minor_cb_ = nullptr;
ResetSkillCd(); ResetSkillCd();
if (owner->IsHuman()) { if (owner->IsHuman()) {
Human* hum = owner->AsHuman(); Human* hum = owner->AsHuman();
@ -205,6 +197,14 @@ void Skill::AddMinorMode(
); );
NotifySkillState(); NotifySkillState();
} }
} else if (a8::TIMER_DELETE_EVENT == event) {
minor_type_ = SMT_NONE;
minor_cd_time_ = 0;
minor_frameno_ = 0;
if (minor_cb_) {
minor_cb_(0);
}
minor_cb_ = nullptr;
} }
}, },
&xtimer_attacher); &xtimer_attacher);