1
This commit is contained in:
parent
b28668f568
commit
a4a44b56ce
@ -6,6 +6,8 @@
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
#include <glm/vec2.hpp>
|
||||
|
||||
#include <a8/collision.h>
|
||||
|
||||
#include "creature.h"
|
||||
#include "room.h"
|
||||
#include "skill.h"
|
||||
@ -3007,10 +3009,20 @@ void Creature::NetInitOk()
|
||||
|
||||
bool Creature::IsNearGas(float distance)
|
||||
{
|
||||
Position p;
|
||||
p.FromGlmVec3(glm::vec3(room->GetGasData().pos_new.x, 0, room->GetGasData().pos_new.y));
|
||||
float gas_distance = GetPos().Distance2D2(p);
|
||||
return gas_distance + GetRadius() * 2 + distance > room->GetGasData().rad_new;
|
||||
float radius = GetRadius() + distance;
|
||||
bool b1 = a8::CircleContainCircle
|
||||
(room->GetGasData().pos_old,
|
||||
room->GetGasData().gas_progress,
|
||||
glm::vec2(GetPos().GetX(), GetPos().GetZ()),
|
||||
radius
|
||||
);
|
||||
bool b2 = a8::CircleContainCircle
|
||||
(room->GetGasData().pos_new,
|
||||
room->GetGasData().rad_new,
|
||||
glm::vec2(GetPos().GetX(), GetPos().GetZ()),
|
||||
radius
|
||||
);
|
||||
return !b1 && !b2;
|
||||
}
|
||||
|
||||
float Creature::GetSafeAreaRaidus()
|
||||
|
Loading…
x
Reference in New Issue
Block a user