remove touch object
This commit is contained in:
parent
da61f163bf
commit
2b119145c7
@ -106,7 +106,6 @@ void Bullet::OnHit(std::set<Entity*>& objects)
|
|||||||
#ifdef RAY_DETECTION
|
#ifdef RAY_DETECTION
|
||||||
if (!obstacle->observer_set.empty()) {
|
if (!obstacle->observer_set.empty()) {
|
||||||
for (Bullet* bullet : obstacle->observer_set) {
|
for (Bullet* bullet : obstacle->observer_set) {
|
||||||
bullet->touch_object = nullptr;
|
|
||||||
bullet->RayDetection();
|
bullet->RayDetection();
|
||||||
}
|
}
|
||||||
obstacle->observer_set.clear();
|
obstacle->observer_set.clear();
|
||||||
@ -245,10 +244,6 @@ void Bullet::RayDetectionUpdate()
|
|||||||
void Bullet::ClearRayData()
|
void Bullet::ClearRayData()
|
||||||
{
|
{
|
||||||
#ifdef RAY_DETECTION
|
#ifdef RAY_DETECTION
|
||||||
if (touch_object) {
|
|
||||||
touch_object->observer_set.erae(this);
|
|
||||||
touch_object = nullptr;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@ class Bullet : public Entity
|
|||||||
#ifdef RAY_DETECTION
|
#ifdef RAY_DETECTION
|
||||||
float target_distance = 0.0f;
|
float target_distance = 0.0f;
|
||||||
Vector2D target_point;
|
Vector2D target_point;
|
||||||
Obstacle* touch_object = nullptr;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Bullet();
|
Bullet();
|
||||||
|
@ -36,9 +36,6 @@ class Obstacle : public Entity
|
|||||||
int door_house_uniid = 0;
|
int door_house_uniid = 0;
|
||||||
const metatable::DoorObjJson* door_state0 = nullptr;
|
const metatable::DoorObjJson* door_state0 = nullptr;
|
||||||
const metatable::DoorObjJson* door_state1 = nullptr;
|
const metatable::DoorObjJson* door_state1 = nullptr;
|
||||||
#ifdef RAY_DETECTION
|
|
||||||
std::set<Bullet*> observer_set;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Obstacle();
|
Obstacle();
|
||||||
virtual ~Obstacle() override;
|
virtual ~Obstacle() override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user