From 724e7393bfc787bc7d16e57301f96c1456fc9483 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 12 Apr 2021 15:56:04 +0800 Subject: [PATCH] 1 --- server/gameserver/room.cc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 0adeb2a..efb64bf 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -1158,6 +1158,19 @@ void Room::UpdateGasInactive() NotifyWxVoip(); InitAirDrop(); InitAndroidAI(); +#if 1 + xtimer.AddDeadLineTimerAndAttach + (SERVER_FRAME_RATE * 1, + a8::XParams() + .SetSender(this), + [] (const a8::XParams& param) + { + Room* room = (Room*)param.sender.GetUserData(); + room->ProcDisableHuman(); + room->SecondRandPoint(); + }, + &xtimer_attacher_.timer_list_); +#endif RoomMgr::Instance()->ActiveRoom(GetRoomUuid()); int auto_jump_interval = MetaMgr::Instance()->GetSysParamAsInt("auto_jump_interval"); auto_jump_timer_ = xtimer.AddRepeatTimerAndAttach @@ -2673,6 +2686,15 @@ bool Room::HasPlayerInRound(const a8::Vec2& pos, float rad) void Room::ProcDisableHuman() { + #if 1 + for (auto& pair : human_hash_) { + if (pair.second->IsAndroid() && + pair.second->team_uuid.empty() && + !a8::HasBitFlag(pair.second->status, HS_Disable)) { + DisableHuman(pair.second); + } + } + #else if (room_type_ == RT_NewBrid || room_type_ == RT_MidBrid) { for (auto& pair : human_hash_) { if (pair.second->IsAndroid() && @@ -2682,6 +2704,7 @@ void Room::ProcDisableHuman() } } } + #endif } void Room::OnHumanGridChg(Human* target)