From b63d6a1c50e6e5c58be2773b9d290e853806a55e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 29 Sep 2022 21:11:49 +0800 Subject: [PATCH] 1 --- server/gameserver/room.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 4997231e..4f843352 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -2443,7 +2443,7 @@ long long Room::GetGasInactiveTime() App::Instance()->debug_params[1] : 10; #endif if (IsPveRoom()) { - return 10; + return 0; } else { return MetaMgr::Instance()->gas_inactive_time; } @@ -3664,6 +3664,7 @@ void Room::InitAndroidAI() continue; #endif #endif + bool found = false; int rnd = rand() % ai_weights_space; ++rnd; for (auto& tuple : *ai_weights) { @@ -3672,9 +3673,22 @@ void Room::InitAndroidAI() if (rnd <= space) { hum->SetAiLevel(ai_level); ++ai_num[ai_level]; + found = true; break; } } + if (!found) { + int ai_level = 1; + hum->SetAiLevel(ai_level); + ++ai_num[ai_level]; + } +#ifdef DEBGU + a8::XPrintf("id:%d found:%d\n", + { + hum->GetUniId(), + found ? 1 : 0 + }); +#endif } #ifdef DEBUG for (auto& pair : accountid_hash_) {