diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 3739d117..9aa0546e 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_) {