- Timestamp:
- Apr 10, 2014, 3:45:56 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/modularships/src/orxonox/worldentities/pawns/ModularSpaceShip.cc
r10023 r10029 78 78 { 79 79 // iterate through all attached objects 80 for (unsigned int i=0; i < 100; i++)80 for (unsigned int i=0; i < this->getNumAttachedObj(); i++) 81 81 { 82 82 if (this->getAttachedObject(i) == NULL) 83 { 83 84 break; 85 } 84 86 // iterate through all attached parts 85 87 for(unsigned int j = 0; j < this->partList_.size(); j++) … … 149 151 void ModularSpaceShip::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs) 150 152 { 151 orxout() << "Mdamage(): Collision detected on " << this->getRadarName() << ", btCS*: " << cs << endl;153 /*orxout() << "Mdamage(): Collision detected on " << this->getRadarName() << ", btCS*: " << cs << endl; 152 154 orxout() << "UserPtr of said collisionShape: " << cs->getUserPointer() << endl; 153 155 … … 177 179 //orxout() << "ShipPart of Entity " << cs->getUserPointer() << ": " << this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) << endl; 178 180 179 orxout() << "CP_start" << endl;180 181 181 if (this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) != NULL) 182 182 this->getPartOfEntity((StaticEntity*)(cs->getUserPointer()))->handleHit(damage, healthdamage, shielddamage, originator); 183 183 else 184 184 SpaceShip::damage(damage, healthdamage, shielddamage, originator, cs); 185 186 orxout() << "CP_end" << endl;187 185 188 186 /* … … 267 265 { 268 266 if(this->partList_[i] == part) 267 { 269 268 this->partList_.erase(it); 269 break; 270 } 270 271 it++; 271 272 } … … 275 276 if (itt->second == part) 276 277 { 277 this->detach(itt->first); 278 //this->detach(itt->first); 279 //itt->first->destroy(); 280 itt->first->setActive(false); 281 itt->first->setVisible(false); 282 itt->first->setCollisionResponse(false); 278 283 this->partMap_.erase(itt); 279 284 }
Note: See TracChangeset
for help on using the changeset viewer.