1
This commit is contained in:
parent
5c37a61681
commit
00cea231a5
@ -3195,7 +3195,9 @@ void Human::OnBuffRemove(const Buff& buff)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
room->frame_event.RemoveBuff(this, buff.meta->i->buff_id());
|
||||
if (!buff.meta->i->only_server()) {
|
||||
room->frame_event.RemoveBuff(this, buff.meta->i->buff_id());
|
||||
}
|
||||
}
|
||||
|
||||
void Human::OnLand()
|
||||
|
@ -1,6 +1,8 @@
|
||||
#include "precompile.h"
|
||||
|
||||
#include "incubator.h"
|
||||
#include "room.h"
|
||||
#include "human.h"
|
||||
|
||||
void Incubator::Init()
|
||||
{
|
||||
@ -14,15 +16,30 @@ void Incubator::UnInit()
|
||||
|
||||
void Incubator::RecycleAndroid(Human* hum)
|
||||
{
|
||||
#if 0
|
||||
room->TouchPlayerList
|
||||
Human* nearest_hum = nullptr;
|
||||
Human* target = hum;
|
||||
float distance = 10000000;
|
||||
room->TouchAlivePlayers
|
||||
(
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user