修复宕机问题

This commit is contained in:
aozhiwei 2020-07-31 10:17:48 +08:00
parent fc90b604cc
commit c7d7222519

View File

@ -177,6 +177,9 @@ void Room::AddPlayer(Player* hum)
if (gas_data_.gas_mode != GasInactive) { if (gas_data_.gas_mode != GasInactive) {
abort(); abort();
} }
while (human_hash_.size() > GetRoomMaxPlayerNum()) {
RandRemoveAndroid();
}
hum->born_point = AllocBornPoint(hum); hum->born_point = AllocBornPoint(hum);
if (!hum->born_point) { if (!hum->born_point) {
hum->SetPos(GetDefaultBornPoint()); hum->SetPos(GetDefaultBornPoint());
@ -2657,9 +2660,6 @@ void Room::AddPlayerPostProc(Player* hum)
} }
} }
} }
while (human_hash_.size() > GetRoomMaxPlayerNum()) {
RandRemoveAndroid();
}
if (GetRoomMode() == kZombieMode) { if (GetRoomMode() == kZombieMode) {
#if 0 #if 0
hum->ChangeToRace(kZombieRace, 3); hum->ChangeToRace(kZombieRace, 3);