1
This commit is contained in:
parent
c749f886ff
commit
e544573967
@ -228,7 +228,7 @@ void Incubator::AutoAllocAndroid()
|
||||
case GasWaiting:
|
||||
case GasMoving:
|
||||
{
|
||||
if (!hold_humans_.empty()){
|
||||
if (!hold_humans_.empty() && room->AliveCount() > 6) {
|
||||
Human* hum = hold_humans_[0];
|
||||
if (room->GetGasData().GetGasMode() == GasWaiting &&
|
||||
hold_humans_.size() > 1 &&
|
||||
|
@ -2272,29 +2272,6 @@ bool Room::HasPlayerInRound(const glm::vec3& pos, float rad)
|
||||
return false;
|
||||
}
|
||||
|
||||
void Room::ProcDisableHuman()
|
||||
{
|
||||
#if 1
|
||||
for (auto& pair : human_hash_) {
|
||||
if (pair.second->IsAndroid() &&
|
||||
pair.second->team_uuid.empty() &&
|
||||
!a8::HasBitFlag(pair.second->status, CS_Disable)) {
|
||||
DisableHuman(pair.second);
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (room_type_ == RT_NewBrid || room_type_ == RT_MidBrid) {
|
||||
for (auto& pair : human_hash_) {
|
||||
if (pair.second->IsAndroid() &&
|
||||
pair.second->team_uuid.empty() &&
|
||||
!a8::HasBitFlag(pair.second->status, CS_Disable)) {
|
||||
DisableHuman(pair.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void Room::CheckPartObjects(Human* testa, Human* testb)
|
||||
{
|
||||
#if 0
|
||||
@ -2340,73 +2317,6 @@ void Room::CheckPartObjects(Human* testa, Human* testb)
|
||||
#endif
|
||||
}
|
||||
|
||||
void Room::GetAliveHumans(std::vector<Human*>& alive_humans, size_t num, Human* exclude_hum)
|
||||
{
|
||||
alive_humans.reserve(num);
|
||||
{
|
||||
if (GetFrameNo() % 8 < 5) {
|
||||
for (auto itr = human_hash_.begin(); itr != human_hash_.end(); ++itr) {
|
||||
if (itr->second == exclude_hum) {
|
||||
continue;
|
||||
}
|
||||
CheckAliveHuman(itr->second, alive_humans);
|
||||
if (alive_humans.size() > num) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (auto itr = human_hash_.rbegin(); itr != human_hash_.rend(); ++itr) {
|
||||
if (itr->second == exclude_hum) {
|
||||
continue;
|
||||
}
|
||||
CheckAliveHuman(itr->second, alive_humans);
|
||||
if (alive_humans.size() > num) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Room::GetCanAutoDieHumans(std::vector<Human*>& alive_humans, size_t num, Human* exclude_hum)
|
||||
{
|
||||
alive_humans.reserve(num);
|
||||
{
|
||||
if (GetFrameNo() % 8 < 5) {
|
||||
for (auto itr = human_hash_.begin(); itr != human_hash_.end(); ++itr) {
|
||||
if (itr->second == exclude_hum) {
|
||||
continue;
|
||||
}
|
||||
CheckAliveHuman(itr->second, alive_humans);
|
||||
if (alive_humans.size() > num) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (auto itr = human_hash_.rbegin(); itr != human_hash_.rend(); ++itr) {
|
||||
if (itr->second == exclude_hum) {
|
||||
continue;
|
||||
}
|
||||
CheckAliveHuman(itr->second, alive_humans);
|
||||
if (alive_humans.size() > num) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Room::CheckAliveHuman(Human* hum, std::vector<Human*>& alive_humans)
|
||||
{
|
||||
if (hum->IsAndroid() &&
|
||||
!hum->real_dead &&
|
||||
hum->team_uuid.empty() &&
|
||||
a8::HasBitFlag(hum->status, CS_Disable) &&
|
||||
!HasPlayerInRound(hum->GetPos().ToGlmVec3(), VIEW_RANGE)) {
|
||||
alive_humans.push_back(hum);
|
||||
}
|
||||
}
|
||||
|
||||
bool Room::RuningInTimer()
|
||||
{
|
||||
return xtimer.IsRunning();
|
||||
|
@ -289,10 +289,6 @@ private:
|
||||
void EnableHuman(Human* hum);
|
||||
void DisableHuman(Human* hum);
|
||||
bool HasPlayerInRound(const glm::vec3& pos, float rad);
|
||||
void ProcDisableHuman();
|
||||
void GetAliveHumans(std::vector<Human*>& alive_humans, size_t num, Human* exclude_hum);
|
||||
void GetCanAutoDieHumans(std::vector<Human*>& alive_humans, size_t num, Human* exclude_hum);
|
||||
void CheckAliveHuman(Human* hum, std::vector<Human*>& alive_humans);
|
||||
|
||||
void AddToEntityHash(Entity* entity);
|
||||
void AddToHumanHash(Human* hum);
|
||||
|
Loading…
x
Reference in New Issue
Block a user