1
This commit is contained in:
parent
896be1d621
commit
0f19b56010
@ -2053,7 +2053,7 @@ void Human::UpdateViewObjects()
|
||||
});
|
||||
}
|
||||
if (view_objects_.size() < 2) {
|
||||
room->GetIncubator()->AllocAndroid(this, 1 + rand() % 2);
|
||||
room->GetIncubator()->AllocAndroid(this, 1 + rand() % 2, nullptr);
|
||||
if (!refresh_view_timer_.expired()) {
|
||||
room->xtimer.ModifyTime
|
||||
(refresh_view_timer_,
|
||||
|
@ -64,7 +64,7 @@ void Incubator::UnInit()
|
||||
|
||||
}
|
||||
|
||||
void Incubator::AllocAndroid(Human* target, int num)
|
||||
void Incubator::AllocAndroid(Human* target, int num, std::vector<Human*>* androids)
|
||||
{
|
||||
if (!room->xtimer.IsRunning()) {
|
||||
A8_ABORT();
|
||||
@ -236,8 +236,9 @@ void Incubator::AutoAllocAndroid()
|
||||
}
|
||||
}
|
||||
|
||||
void Incubator::ActiveAndroid(Human* hum, Human* android)
|
||||
Human* Incubator::ActiveAndroid(Human* hum)
|
||||
{
|
||||
#if 0
|
||||
glm::vec3 center = glm::vec3(room->GetGasData().pos_new.x,
|
||||
0.0f,
|
||||
room->GetGasData().pos_new.y);
|
||||
@ -272,6 +273,7 @@ void Incubator::ActiveAndroid(Human* hum, Human* android)
|
||||
android->GetPos().GetY()
|
||||
}));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void Incubator::OnEnterNewWave(int wave)
|
||||
|
@ -12,9 +12,9 @@ class Incubator
|
||||
void Init();
|
||||
void UnInit();
|
||||
void InitPve();
|
||||
void AllocAndroid(Human* target, int num);
|
||||
void AllocAndroid(Human* target, int num, std::vector<Human*>* androids);
|
||||
void RecycleAndroid(Human* hum);
|
||||
void ActiveAndroid(Human* hum, Human* android);
|
||||
Human* ActiveAndroid(Human* hum);
|
||||
bool IsTimeOut() { return timeout_; };
|
||||
int GetPveLeftTime();
|
||||
void NextWave();
|
||||
|
@ -845,7 +845,7 @@ Human* Room::GetWatchWarTarget(Human* hum)
|
||||
std::vector<Human*> players;
|
||||
std::vector<Human*> humans;
|
||||
for (auto& pair : human_hash_) {
|
||||
if (pair.first != hum->GetUniId() && !pair.second->dead) {
|
||||
if (pair.first != hum->GetUniId() && !pair.second->dead && !a8::HasBitFlag(pair.second->status, CS_Disable)) {
|
||||
if (pair.second->IsPlayer()) {
|
||||
players.push_back(pair.second);
|
||||
} else {
|
||||
@ -870,8 +870,8 @@ Human* Room::GetWatchWarTarget(Human* hum)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (target && target->IsAndroid() && a8::HasBitFlag(target->status, CS_Disable)) {
|
||||
incubator_->ActiveAndroid(hum, target);
|
||||
if (!target) {
|
||||
target = incubator_->ActiveAndroid(hum);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user