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