Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 9, 2008, 5:33:40 PM (16 years ago)
Author:
landauf
Message:

fixed attach bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/orxonox/objects/worldentities/WorldEntity.cc

    r2162 r2167  
    5959
    6060        this->parent_ = 0;
    61         this->parentID_ = (unsigned int)-1;
     61        this->parentID_ = OBJECTID_UNKNOWN;
    6262
    6363        this->node_->setPosition(Vector3::ZERO);
     
    108108    void WorldEntity::updateParent()
    109109    {
    110         WorldEntity* parent = dynamic_cast<WorldEntity*>(Synchronisable::getSynchronisable(this->parentID_));
    111         if (parent)
    112             this->attachToParent(parent);
     110        if (this->parentID_ != OBJECTID_UNKNOWN)
     111        {
     112            WorldEntity* parent = dynamic_cast<WorldEntity*>(Synchronisable::getSynchronisable(this->parentID_));
     113            if (parent)
     114                this->attachToParent(parent);
     115        }
    113116    }
    114117
     
    135138        this->children_.erase(object);
    136139        object->parent_ = 0;
    137         object->parentID_ = (unsigned int)-1;
     140        object->parentID_ = OBJECTID_UNKNOWN;
    138141
    139142//        this->getScene()->getRootSceneNode()->addChild(object->node_);
Note: See TracChangeset for help on using the changeset viewer.