Changeset 10414 for code/branches/core7/src
- Timestamp:
- May 3, 2015, 11:47:50 AM (10 years ago)
- Location:
- code/branches/core7/src/orxonox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/orxonox/ShipPartManager.cc
r10413 r10414 46 46 ShipPartManager::~ShipPartManager() 47 47 { 48 // Be sure to delete all the pawns48 // Be sure to delete all the ship parts 49 49 for (ObjectList<ShipPart>::iterator it = ObjectList<ShipPart>::begin(); it != ObjectList<ShipPart>::end(); ) 50 (it++)->de ath();50 (it++)->destroy(); 51 51 } 52 52 … … 56 56 { 57 57 if (!it->isAlive()) 58 (it++)->de ath();58 (it++)->destroy(); 59 59 else 60 60 ++it; -
code/branches/core7/src/orxonox/items/ShipPart.cc
r10262 r10414 50 50 51 51 ShipPart::ShipPart(Context* context) 52 : Item(context) 52 : Item(context), parent_(NULL) 53 53 { 54 54 RegisterObject(ShipPart); 55 this-> setAlive(true);56 this-> setEventExecution(true);55 this->alive_ = true; 56 this->eventExecution_ = true; 57 57 this->healthMem_ = 100; 58 58 } … … 60 60 ShipPart::~ShipPart() 61 61 { 62 62 if (this->parent_) 63 { 64 // Remove this ShipPart from the parent. 65 this->parent_->removeShipPart(this); 66 } 63 67 } 64 68 … … 100 104 } 101 105 } 102 103 // Remove this ShipPart from the parent.104 this->parent_->removeShipPart(this);105 delete this;106 106 } 107 107 … … 240 240 } 241 241 if (this->health_ < 0) 242 this->alive_ = false; 243 //this->death(); 242 this->death(); 244 243 245 244 // (Ugly) Chatoutput of health, until a GUI for modularspaceships-shipparts is implemented. -
code/branches/core7/src/orxonox/worldentities/pawns/ModularSpaceShip.cc
r10347 r10414 69 69 if (this->isInitialized()) 70 70 { 71 71 while (!this->partList_.empty()) 72 this->partList_[0]->destroy(); 72 73 } 73 74 } … … 177 178 if (it->second->getName() == name) 178 179 { 179 it->second-> setAlive(false);180 it->second->death(); 180 181 return; 181 182 } … … 196 197 if (it->second->getName() == name) 197 198 { 198 it->second-> setAlive(false);199 it->second->death(); 199 200 return; 200 201 }
Note: See TracChangeset
for help on using the changeset viewer.