Changeset 5826 in orxonox.OLD for trunk/src/world_entities/weapons
- Timestamp:
- Nov 29, 2005, 11:52:31 PM (19 years ago)
- Location:
- trunk/src/world_entities/weapons
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/weapons/bomb.cc
r5769 r5826 17 17 #include "glincl.h" 18 18 #include "state.h" 19 #include "model.h" 20 #include "fast_factory.h" 19 21 #include "list.h" 20 #include "model.h"21 #include "vector.h"22 #include "fast_factory.h"23 22 23 #include "object_manager.h" 24 24 25 25 #include "particle_engine.h" … … 114 114 this->deactivate(); 115 115 } 116 if (this->lifeCycle > 0.9f) 117 this->detonate ((this->lifeCycle-.89) *10000.0); 116 118 } 117 119 … … 145 147 void Bomb::collidesWith (WorldEntity* entity, const Vector& location) 146 148 { 147 this->detonate(); 149 if (entity->isA(CL_NPC)) 150 this->lifeSpan = 0.9f; 148 151 } 149 152 … … 160 163 } 161 164 162 void Bomb::detonate( )165 void Bomb::detonate(float size) 163 166 { 164 tIterator<WorldEntity>* it = State::getWorldEntityList()->getIterator(); 165 WorldEntity* lm = it->firstElement(); 166 167 while(lm != NULL) 167 std::list<WorldEntity*>* detonationList = ObjectManager::distanceFromObject(*this, size, CL_NPC); 168 if (detonationList != NULL) 168 169 { 169 170 lm = it->nextElement(); 170 while( !detonationList->empty() ) 171 { 172 //detonationList->front()->collidesWith(this, Vector(0,0,0)); 173 detonationList->pop_front(); 174 } 175 delete detonationList; 171 176 } 172 177 } -
trunk/src/world_entities/weapons/bomb.h
r5750 r5826 31 31 virtual void collidesWith (WorldEntity* entity, const Vector& location); 32 32 virtual void activate(); 33 virtual void detonate();34 33 virtual void deactivate(); 34 35 void detonate(float size); 35 36 36 37 private:
Note: See TracChangeset
for help on using the changeset viewer.