Changeset 6134 in orxonox.OLD for branches/objectmanager/src/world_entities
- Timestamp:
- Dec 16, 2005, 5:16:00 PM (19 years ago)
- Location:
- branches/objectmanager/src/world_entities
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/objectmanager/src/world_entities/npcs/npc.cc
r6121 r6134 50 50 WorldEntity* powerUp = new TurretPowerUp(); 51 51 powerUp->setAbsCoor(this->getAbsCoor()); 52 State::getWorldEntityList()->add(powerUp);52 powerUp->toList(OM_COMMON); 53 53 } 54 54 else if ((float)rand()/RAND_MAX < .3) … … 56 56 WorldEntity* powerUp = new LaserPowerUp(); 57 57 powerUp->setAbsCoor(this->getAbsCoor()); 58 State::getWorldEntityList()->add(powerUp);58 powerUp->toList(OM_COMMON); 59 59 } 60 State::getWorldEntityList()->remove(this);60 this->toList(OM_DEAD); 61 61 this->removeNode(); 62 62 … … 68 68 { 69 69 this->setVisibiliy(false); 70 State::getWorldEntityList()->remove(this);70 this->toList(OM_DEAD); 71 71 this->removeNode(); 72 72 } -
branches/objectmanager/src/world_entities/power_ups/laser_power_up.cc
r5994 r6134 80 80 // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z); 81 81 if (entity->isA(CL_PLAYABLE)) 82 State::getWorldEntityList()->remove(this);82 this->toList(OM_DEAD); 83 83 } 84 84 -
branches/objectmanager/src/world_entities/power_ups/turret_power_up.cc
r5994 r6134 80 80 // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z); 81 81 if (entity->isA(CL_PLAYABLE)) 82 State::getWorldEntityList()->remove(this);82 this->toList(OM_DEAD); 83 83 } 84 84 -
branches/objectmanager/src/world_entities/test_entity.cc
r6122 r6134 71 71 PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getName(), entity->getName(), location.x, location.y, location.z); 72 72 this->setVisibiliy(false); 73 State::getWorldEntityList()->remove(this);73 this->toList(OM_DEAD); 74 74 } 75 75 } -
branches/objectmanager/src/world_entities/weapons/aim.cc
r6078 r6134 104 104 void Aim::searchTarget(float range) 105 105 { 106 tIterator<WorldEntity>* iterator = State::getWorldEntityList()->getIterator(); 106 //FIXME// 107 /* tIterator<WorldEntity>* iterator = State::getWorldEntityList()->getIterator(); 107 108 WorldEntity* entity = iterator->firstElement(); 108 109 while (likely(entity != NULL)) … … 121 122 } 122 123 123 delete iterator; 124 delete iterator;*/ 124 125 } 125 126 -
branches/objectmanager/src/world_entities/weapons/bomb.cc
r6123 r6134 174 174 void Bomb::activate() 175 175 { 176 State::getWorldEntityList()->add(this);177 176 178 177 } … … 180 179 void Bomb::deactivate() 181 180 { 182 this->toList(OM_NULL); 183 State::getWorldEntityList()->remove(this); 181 this->toList(OM_DEAD); 184 182 this->lifeCycle = 0.0f; 185 183 Bomb::fastFactory->kill(this); -
branches/objectmanager/src/world_entities/weapons/guided_missile.cc
r6126 r6134 85 85 void GuidedMissile::activate() 86 86 { 87 State::getWorldEntityList()->add(this);88 87 if (unlikely(GuidedMissile::trailParticles == NULL)) 89 88 { … … 129 128 this->lifeCycle = 0.0; 130 129 131 this->toList(OM_NULL); 132 // GarbageCollector::getInstance()->collect(this); 133 State::getWorldEntityList()->remove(this); 130 this->toList(OM_DEAD); 134 131 this->removeNode(); 135 132 GuidedMissile::fastFactory->kill(this); -
branches/objectmanager/src/world_entities/weapons/laser.cc
r6123 r6134 77 77 void Laser::activate() 78 78 { 79 State::getWorldEntityList()->add(this);80 79 if (unlikely(Laser::explosionParticles == NULL)) 81 80 { … … 99 98 this->toList(OM_NULL); 100 99 101 State::getWorldEntityList()->remove(this);100 this->toList(OM_DEAD); 102 101 this->removeNode(); 103 102 Laser::fastFactory->kill(this); -
branches/objectmanager/src/world_entities/weapons/projectile.cc
r6078 r6134 22 22 #include "weapon.h" 23 23 #include "model.h" 24 25 #include "garbage_collector.h"26 24 27 25 using namespace std; -
branches/objectmanager/src/world_entities/weapons/rocket.cc
r6123 r6134 82 82 void Rocket::activate() 83 83 { 84 State::getWorldEntityList()->add(this);85 84 if (unlikely(Rocket::trailParticles == NULL)) 86 85 { … … 128 127 129 128 // GarbageCollector::getInstance()->collect(this); 130 State::getWorldEntityList()->remove(this);129 this->toList(OM_DEAD); 131 130 Rocket::fastFactory->kill(this); 132 131 } -
branches/objectmanager/src/world_entities/weapons/test_bullet.cc
r6123 r6134 82 82 void TestBullet::activate() 83 83 { 84 State::getWorldEntityList()->add(this);85 84 if (unlikely(TestBullet::trailParticles == NULL)) 86 85 { … … 121 120 this->toList(OM_NULL); 122 121 123 // GarbageCollector::getInstance()->collect(this);124 State::getWorldEntityList()->remove(this);125 122 TestBullet::fastFactory->kill(this); 126 123 }
Note: See TracChangeset
for help on using the changeset viewer.