Merge branch 'online' into dev
This commit is contained in:
commit
7ad03facd1
@ -69,11 +69,11 @@
|
||||
</node>
|
||||
<node class="DecoratorWeight" id="20">
|
||||
<property DecorateWhenChildEnds="false" />
|
||||
<property Weight="const int 1" />
|
||||
<property Weight="const int 80" />
|
||||
<node class="IfElse" id="21">
|
||||
<node class="Condition" id="22">
|
||||
<property Operator="Equal" />
|
||||
<property Opl="Self.BaseAgent::HasTarget(200)" />
|
||||
<property Opl="Self.BaseAgent::HasTarget(300)" />
|
||||
<property Opr="const bool true" />
|
||||
</node>
|
||||
<node class="Action" id="23">
|
||||
|
@ -436,6 +436,18 @@ void GridService::TraverseObstacles(int room_idx,
|
||||
|
||||
void GridService::DeatchHuman(Human* target)
|
||||
{
|
||||
#if 1
|
||||
target->room->TraverseHumanList
|
||||
(
|
||||
[target] (Human* hum)
|
||||
{
|
||||
hum->AddOutObjects(target);
|
||||
return true;
|
||||
});
|
||||
for (auto& cell : target->GetGridList()) {
|
||||
cell->RemoveCreature(target);
|
||||
}
|
||||
#else
|
||||
for (auto& cell : target->GetGridList()) {
|
||||
bool stop = false;
|
||||
cell->TraverseHumanList
|
||||
@ -448,6 +460,7 @@ void GridService::DeatchHuman(Human* target)
|
||||
stop);
|
||||
cell->RemoveCreature(target);
|
||||
}
|
||||
#endif
|
||||
target->SetGridId(0);
|
||||
target->GetGridList().clear();
|
||||
}
|
||||
|
@ -70,6 +70,9 @@ void Incubator::AllocAndroid(Human* target, int num, std::vector<Human*>* androi
|
||||
if (!room->xtimer.IsRunning()) {
|
||||
A8_ABORT();
|
||||
}
|
||||
if (target->room->IsGameOver()) {
|
||||
return;
|
||||
}
|
||||
int try_count = 0;
|
||||
glm::vec3 dir = GlmHelper::UP;
|
||||
while (num > 0 && try_count < 8 && !hold_humans_.empty()) {
|
||||
|
@ -438,6 +438,7 @@ Human* Room::FindEnemy(Human* hum, float range)
|
||||
[&target, myself, range, &last_distance] (Human* hum)
|
||||
{
|
||||
if (!hum->dead &&
|
||||
!a8::HasBitFlag(hum->status, CS_Disable) &&
|
||||
hum->team_id != myself->team_id) {
|
||||
float distance = hum->GetPos().Distance2D2(myself->GetPos());
|
||||
if (distance <= range) {
|
||||
@ -462,6 +463,7 @@ Creature* Room::FindEnemy(Creature* c, float range)
|
||||
[&target, myself, range, &last_distance] (Human* hum)
|
||||
{
|
||||
if (!hum->dead &&
|
||||
!a8::HasBitFlag(hum->status, CS_Disable) &&
|
||||
hum->team_id != myself->team_id) {
|
||||
float distance = hum->GetPos().Distance2D2(myself->GetPos());
|
||||
if (distance <= range) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user