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
Location:
code/branches/objecthierarchy2/src/orxonox/objects/worldentities
Files:
2 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
  • code/branches/objecthierarchy2/src/orxonox/objects/worldentities/pawns/Pawn.cc

    r2422 r2438  
    160160        this->bAlive_ = false;
    161161
     162        this->setDestroyWhenPlayerLeft(false);
     163
    162164        if (this->getGametype())
    163165            this->getGametype()->pawnKilled(this, this->lastHitOriginator_);
    164 
    165         this->setDestroyWhenPlayerLeft(false);
    166166
    167167        if (this->getPlayer())
Note: See TracChangeset for help on using the changeset viewer.