修复最后一圈机器人未刷出问题

This commit is contained in:
aozhiwei 2020-06-29 20:06:48 +08:00
parent 253eccfdce
commit 30b1ddbdd2
3 changed files with 61 additions and 2 deletions

View File

@ -960,6 +960,23 @@ void Room::UpdateGasMoving()
}
gas_data_.rad_old = gas_data_.old_area_meta->i->rad();
gas_data_.rad_new = gas_data_.new_area_meta->i->rad();
if (!MetaMgr::Instance()->GetSafeArea(gas_data_.new_area_meta->i->id() + 1)) {
#if 1
//最后一圈
if (room_type_ == RT_MidBrid) {
xtimer.AddDeadLineTimerAndAttach
(2,
a8::XParams()
.SetSender(this),
[] (const a8::XParams& param)
{
Room* room = (Room*)param.sender.GetUserData();
room->ShuaLastGas();
},
&xtimer_attacher_.timer_list_);
}
#endif
}
}
}
}
@ -2772,3 +2789,40 @@ void Room::ShowHand()
}
}
}
void Room::ShuaLastGas()
{
for (auto& pair : human_hash_) {
Human* hum = pair.second;
if (hum->IsAndroid() &&
a8::HasBitFlag(hum->status, HS_Disable) &&
!a8::HasBitFlag(hum->status, HS_LastAndroid) &&
!hum->real_dead &&
hum->team_uuid.empty()
) {
EnableHuman(hum);
xtimer.AddDeadLineTimerAndAttach
(
SERVER_FRAME_RATE * 10,
a8::XParams()
.SetSender(hum)
.SetParam1(10)
.SetParam2(VIEW_RANGE * 1.5)
.SetParam3(0),
[] (const a8::XParams& param)
{
Human* hum = (Human*)param.sender.GetUserData();
hum->room->CheckAutoDie(
hum,
param.param1,
param.param2,
param.param3
);
},
&hum->xtimer_attacher.timer_list_);
}
}
#ifdef DEBUG
CheckPartObjects();
#endif
}

View File

@ -194,6 +194,7 @@ private:
void SyncFrameData();
void CheckShowHand();
void ShowHand();
void ShuaLastGas();
#ifdef DEBUG
void InitDebugInfo();

View File

@ -31,16 +31,20 @@ static RoomType_e GetHumanRoomType(const cs::CMJoin& msg)
}
//游戏次数,吃鸡数,击杀数
int game_times = a8::XValue(tmp_strings[0]);
#if 1
#else
if (!f8::IsOnlineEnv() || RoomMgr::Instance()->IsGM(msg)) {
game_times = 0;
if (!msg.team_uuid().empty()) {
game_times = 1;
}
}
#if 0
#endif
#if 0
int win_times = a8::XValue(tmp_strings[1]);
int kill_times = a8::XValue(tmp_strings[2]);
#endif
#endif
if (game_times < MetaMgr::Instance()->newbie_game_times) {
return RT_NewBrid;
} else if (game_times == 1) {