This commit is contained in:
aozhiwei 2023-04-01 20:48:36 +08:00
parent 170c5c8365
commit c8d6113fdd

View File

@ -8,6 +8,7 @@
#include "pbutils.h"
#include "glmhelper.h"
#include "mapinstance.h"
#include "bornpoint.h"
#include "mt/Param.h"
#include "mt/Map.h"
@ -249,6 +250,19 @@ Human* Incubator::ActiveAndroid(Human* hum)
target = androids[0];
} else if (!hold_humans_.empty()) {
target = hold_humans_[0];
glm::vec3 center = glm::vec3(room->GetGasData().pos_new.x, 0.0f, room->GetGasData().pos_new.y);
glm::vec3 out_pt;
if (room->map_instance->GetNearestGrass(center, out_pt)) {
Global::Instance()->verify_set_pos = 1;
target->GetMutablePos().FromGlmVec3(out_pt);
Global::Instance()->verify_set_pos = 0;
} else {
Global::Instance()->verify_set_pos = 1;
target->GetMutablePos().FromGlmVec3(target->born_point->RandPoint().ToGlmVec3());
Global::Instance()->verify_set_pos = 0;
}
room->EnableHuman(hum);
hold_humans_.erase(hold_humans_.begin());
}
#ifdef DEBUG
if (target) {