1
This commit is contained in:
parent
5c37a61681
commit
00cea231a5
@ -3195,8 +3195,10 @@ void Human::OnBuffRemove(const Buff& buff)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (!buff.meta->i->only_server()) {
|
||||||
room->frame_event.RemoveBuff(this, buff.meta->i->buff_id());
|
room->frame_event.RemoveBuff(this, buff.meta->i->buff_id());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Human::OnLand()
|
void Human::OnLand()
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#include "precompile.h"
|
#include "precompile.h"
|
||||||
|
|
||||||
#include "incubator.h"
|
#include "incubator.h"
|
||||||
|
#include "room.h"
|
||||||
|
#include "human.h"
|
||||||
|
|
||||||
void Incubator::Init()
|
void Incubator::Init()
|
||||||
{
|
{
|
||||||
@ -14,15 +16,30 @@ void Incubator::UnInit()
|
|||||||
|
|
||||||
void Incubator::RecycleAndroid(Human* hum)
|
void Incubator::RecycleAndroid(Human* hum)
|
||||||
{
|
{
|
||||||
#if 0
|
Human* nearest_hum = nullptr;
|
||||||
room->TouchPlayerList
|
Human* target = hum;
|
||||||
|
float distance = 10000000;
|
||||||
|
room->TouchAlivePlayers
|
||||||
(
|
(
|
||||||
a8::XParams(),
|
a8::XParams(),
|
||||||
[] (Player* hum, a8::XParams& param)
|
[&nearest_hum, target, &distance] (Human* hum, a8::XParams& param) -> bool
|
||||||
{
|
{
|
||||||
|
float tmp_distance = hum->GetPos().ManhattanDistance(target->GetPos());
|
||||||
|
if (tmp_distance < distance) {
|
||||||
|
nearest_hum = hum;
|
||||||
|
distance = tmp_distance;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
});
|
});
|
||||||
#endif
|
if (distance < 450) {
|
||||||
|
hum->RemoveBuffByEffectId(kBET_BeRecycle);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (distance > 1450) {
|
||||||
|
hum->RemoveBuffByEffectId(kBET_BeRecycle);
|
||||||
|
AddHoldHuman(nearest_hum);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Incubator::AddHoldHuman(Human* hum)
|
void Incubator::AddHoldHuman(Human* hum)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user