remove touch object

This commit is contained in:
aozhiwei 2019-06-07 21:01:38 +08:00
parent da61f163bf
commit 2b119145c7
3 changed files with 0 additions and 9 deletions

View File

@ -106,7 +106,6 @@ void Bullet::OnHit(std::set<Entity*>& objects)
#ifdef RAY_DETECTION
if (!obstacle->observer_set.empty()) {
for (Bullet* bullet : obstacle->observer_set) {
bullet->touch_object = nullptr;
bullet->RayDetection();
}
obstacle->observer_set.clear();
@ -245,10 +244,6 @@ void Bullet::RayDetectionUpdate()
void Bullet::ClearRayData()
{
#ifdef RAY_DETECTION
if (touch_object) {
touch_object->observer_set.erae(this);
touch_object = nullptr;
}
#endif
}

View File

@ -26,7 +26,6 @@ class Bullet : public Entity
#ifdef RAY_DETECTION
float target_distance = 0.0f;
Vector2D target_point;
Obstacle* touch_object = nullptr;
#endif
Bullet();

View File

@ -36,9 +36,6 @@ class Obstacle : public Entity
int door_house_uniid = 0;
const metatable::DoorObjJson* door_state0 = nullptr;
const metatable::DoorObjJson* door_state1 = nullptr;
#ifdef RAY_DETECTION
std::set<Bullet*> observer_set;
#endif
Obstacle();
virtual ~Obstacle() override;