Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 14, 2008, 3:53:05 AM (16 years ago)
Author:
landauf
Message:
  • If the player dies, the Spectator spawns at the same position the players camera was before.
  • Fixed some related problems and potential bugs
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy2/src/orxonox/objects/worldentities/ControllableEntity.cc

    r2428 r2438  
    8181        if (this->isInitialized())
    8282        {
    83             if (this->bHasLocalController_)
     83            if (this->bHasLocalController_ && this->bHasHumanController_)
    8484                this->stopLocalHumanControl();
    8585
     
    250250    void ControllableEntity::stopLocalHumanControl()
    251251    {
    252         this->camera_->detachFromParent();
    253         delete this->camera_;
    254         this->camera_ = 0;
    255 
    256         delete this->hud_;
    257         this->hud_ = 0;
     252        if (this->camera_)
     253        {
     254            this->camera_->detachFromParent();
     255            delete this->camera_;
     256            this->camera_ = 0;
     257        }
     258
     259        if (this->hud_)
     260        {
     261            delete this->hud_;
     262            this->hud_ = 0;
     263        }
    258264    }
    259265
Note: See TracChangeset for help on using the changeset viewer.