This commit is contained in:
aozhiwei 2021-04-12 15:56:04 +08:00
parent 40f7499e8d
commit 724e7393bf

View File

@ -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)