- Timestamp:
- Oct 13, 2009, 5:05:17 PM (16 years ago)
- Location:
- code/branches/pickup
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup
- Property svn:mergeinfo changed
-
code/branches/pickup/src/orxonox/worldentities/ControllableEntity.cc
r5781 r5935 96 96 97 97 if (this->xmlcontroller_) 98 delete this->xmlcontroller_;98 this->xmlcontroller_->destroy(); 99 99 100 100 if (this->hud_) 101 delete this->hud_;101 this->hud_->destroy(); 102 102 103 103 if (this->camera_) 104 delete this->camera_;105 106 for (std::list< CameraPosition*>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)107 delete (*it);104 this->camera_->destroy(); 105 106 for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 107 (*it)->destroy(); 108 108 109 109 if (this->getScene()->getSceneManager()) … … 153 153 { 154 154 unsigned int i = 0; 155 for (std::list< CameraPosition*>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)155 for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 156 156 { 157 157 if (i == index) … … 172 172 else if (this->cameraPositions_.size() > 0) 173 173 { 174 for (std::list< CameraPosition*>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)174 for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 175 175 { 176 176 if ((*it) == this->camera_->getParent()) … … 238 238 { 239 239 this->client_overwrite_ = this->server_overwrite_; 240 this->set ObjectMode(ObjectDirection::Bidirectional);240 this->setSyncMode(ObjectDirection::Bidirectional); 241 241 } 242 242 } … … 254 254 this->bHasLocalController_ = false; 255 255 this->bHasHumanController_ = false; 256 this->set ObjectMode(ObjectDirection::ToClient);256 this->setSyncMode(ObjectDirection::ToClient); 257 257 258 258 this->changedPlayer(); 259 259 260 260 if (this->bDestroyWhenPlayerLeft_) 261 delete this;261 this->destroy(); 262 262 } 263 263 … … 275 275 void ControllableEntity::startLocalHumanControl() 276 276 { 277 if (!this->camera_ )277 if (!this->camera_ && GameMode::showsGraphics()) 278 278 { 279 279 this->camera_ = new Camera(this); … … 287 287 } 288 288 289 if (!this->hud_ )289 if (!this->hud_ && GameMode::showsGraphics()) 290 290 { 291 291 if (this->hudtemplate_ != "") … … 303 303 { 304 304 this->camera_->detachFromParent(); 305 delete this->camera_;305 this->camera_->destroy(); 306 306 this->camera_ = 0; 307 307 } … … 309 309 if (this->hud_) 310 310 { 311 delete this->hud_;311 this->hud_->destroy(); 312 312 this->hud_ = 0; 313 313 } … … 333 333 if (parent) 334 334 { 335 for (std::list< CameraPosition*>::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)335 for (std::list<SmartPtr<CameraPosition> >::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 336 336 if ((*it)->getIsAbsolute()) 337 337 parent->attach((*it));
Note: See TracChangeset
for help on using the changeset viewer.