- Timestamp:
- Jan 17, 2016, 8:40:36 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3/src/orxonox/items/MultiStateEngine.cc
r11068 r11070 86 86 // We have no ship, so the effects are not attached and won't be destroyed automatically 87 87 for (EffectContainer* container : this->effectContainers_) 88 for ( std::vector<WorldEntity*>::const_iterator it = container->getEffectsBegin(); it != container->getEffectsBegin(); ++it)89 (*it)->destroy();88 for (WorldEntity* effect : container->getEffects()) 89 effect->destroy(); 90 90 if (this->defEngineSndNormal_) 91 91 this->defEngineSndNormal_->destroy(); … … 199 199 200 200 for (EffectContainer* container : this->effectContainers_) 201 for ( std::vector<WorldEntity*>::const_iterator it = container->getEffectsBegin(); it != container->getEffectsEnd(); ++it)202 this->getShip()->attach( *it);203 } 204 205 void MultiStateEngine::addEffectContainer(EffectContainer* effect)206 { 207 if ( effect== nullptr)201 for (WorldEntity* effect : container->getEffects()) 202 this->getShip()->attach(effect); 203 } 204 205 void MultiStateEngine::addEffectContainer(EffectContainer* container) 206 { 207 if (container == nullptr) 208 208 return; 209 effect->setLuaState(this->lua_, 'f' + multi_cast<std::string>(this->effectContainers_.size()));210 this->effectContainers_.push_back( effect);209 container->setLuaState(this->lua_, 'f' + multi_cast<std::string>(this->effectContainers_.size())); 210 this->effectContainers_.push_back(container); 211 211 if (this->getShip()) 212 212 { 213 for ( std::vector<WorldEntity*>::const_iterator it = effect->getEffectsBegin(); it != effect->getEffectsBegin(); ++it)214 this->getShip()->attach( *it);213 for (WorldEntity* effect : container->getEffects()) 214 this->getShip()->attach(effect); 215 215 } 216 216 }
Note: See TracChangeset
for help on using the changeset viewer.