Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 10, 2014, 3:45:56 PM (10 years ago)
Author:
noep
Message:

Fixed a bug where part-entity-assignments were not created.

Location:
code/branches/modularships/src/orxonox/worldentities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/modularships/src/orxonox/worldentities/WorldEntity.h

    r10011 r10029  
    206206
    207207            void notifyChildPropsChanged();
     208
     209            inline int getNumAttachedObj()
     210                { return this->children_.size(); }
    208211
    209212        protected:
  • code/branches/modularships/src/orxonox/worldentities/pawns/ModularSpaceShip.cc

    r10023 r10029  
    7878    {
    7979        // iterate through all attached objects
    80         for (unsigned int i=0; i < 100; i++)
     80        for (unsigned int i=0; i < this->getNumAttachedObj(); i++)
    8181        {
    8282            if (this->getAttachedObject(i) == NULL)
     83            {
    8384                break;
     85            }
    8486            // iterate through all attached parts
    8587            for(unsigned int j = 0; j < this->partList_.size(); j++)
     
    149151    void ModularSpaceShip::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs)
    150152    {
    151         orxout() << "Mdamage(): Collision detected on " << this->getRadarName() << ", btCS*: " << cs << endl;
     153        /*orxout() << "Mdamage(): Collision detected on " << this->getRadarName() << ", btCS*: " << cs << endl;
    152154        orxout() << "UserPtr of said collisionShape: " << cs->getUserPointer() << endl;
    153155
     
    177179        //orxout() << "ShipPart of Entity " << cs->getUserPointer() << ": " << this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) << endl;
    178180
    179         orxout() << "CP_start" << endl;
    180 
    181181        if (this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) != NULL)
    182182            this->getPartOfEntity((StaticEntity*)(cs->getUserPointer()))->handleHit(damage, healthdamage, shielddamage, originator);
    183183        else
    184184            SpaceShip::damage(damage, healthdamage, shielddamage, originator, cs);
    185 
    186         orxout() << "CP_end" << endl;
    187185
    188186        /*
     
    267265        {
    268266            if(this->partList_[i] == part)
     267            {
    269268                this->partList_.erase(it);
     269                break;
     270            }
    270271            it++;
    271272        }
     
    275276            if (itt->second == part)
    276277            {
    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);
    278283                this->partMap_.erase(itt);
    279284            }
Note: See TracChangeset for help on using the changeset viewer.