From 210e9844121ca668f6ad9541534e755ab89207b4 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 20 Apr 2023 15:25:45 +0800 Subject: [PATCH] 1 --- server/gameserver/guide.cc | 8 ++++---- server/gameserver/human.cc | 2 +- server/gameserver/mt/GuideStep.cc | 6 ++++++ server/gameserver/room.cc | 3 +++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/server/gameserver/guide.cc b/server/gameserver/guide.cc index 68d5cd83..6333a063 100644 --- a/server/gameserver/guide.cc +++ b/server/gameserver/guide.cc @@ -71,7 +71,7 @@ void Guide::UpdateStep() void Guide::ProcMoveTarget() { - owner_->room->xtimer.SetTimeoutEx + owner_->room->xtimer.SetIntervalEx (1, [this] (int event, const a8::Args* args) { @@ -129,7 +129,7 @@ void Guide::ProcMoveTargetAndPickup() } } - owner_->room->xtimer.SetTimeoutEx + owner_->room->xtimer.SetIntervalEx (1, [this, context] (int event, const a8::Args* args) { @@ -201,7 +201,7 @@ void Guide::ProcKillEnemy() } } - owner_->room->xtimer.SetTimeoutEx + owner_->room->xtimer.SetIntervalEx (1, [this, context] (int event, const a8::Args* args) { @@ -277,7 +277,7 @@ void Guide::ProcUseSkillAndKillEnemy() } } - owner_->room->xtimer.SetTimeoutEx + owner_->room->xtimer.SetIntervalEx (1, [this, context] (int event, const a8::Args* args) { diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 455aac96..fbb64c27 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -91,7 +91,6 @@ Human::Human():Creature() } stats = std::make_shared(); guide_ = std::make_shared(); - guide_->Init(this); } Human::~Human() @@ -102,6 +101,7 @@ Human::~Human() void Human::Initialize() { Creature::Initialize(); + guide_->Init(this); volume_ = meta->_volume; observers_.insert(this); SetCurrWeapon(&weapons[0]); diff --git a/server/gameserver/mt/GuideStep.cc b/server/gameserver/mt/GuideStep.cc index 0f24fb39..b81db4b5 100644 --- a/server/gameserver/mt/GuideStep.cc +++ b/server/gameserver/mt/GuideStep.cc @@ -41,6 +41,9 @@ namespace mt case KILL_ENEMY_GUIDE_STEP: { for (auto& str : param_strs) { + if (str.size() <= 0) { + break; + } std::vector strings; a8::Split(str, strings, ':'); if (strings.size() != 5) { @@ -62,6 +65,9 @@ namespace mt { for (size_t i = 1; i < param_strs.size(); ++i) { std::string str = param_strs[i]; + if (str.size() <= 0) { + break; + } std::vector strings; a8::Split(str, strings, ':'); if (strings.size() != 5) { diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 0399ce05..71368e9c 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -329,6 +329,9 @@ int Room::AllocUniid() void Room::ShuaAndroid() { + if (IsNewBieRoom()) { + return; + } if (GetGasData().GetGasMode() != GasInactive) { return; }