Changeset 10414 for code/branches/core7/src/orxonox/items
- Timestamp:
- May 3, 2015, 11:47:50 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.
Note: See TracChangeset
for help on using the changeset viewer.