Changeset 6112 for code/branches/presentation2/src/orxonox/worldentities
- Timestamp:
- Nov 21, 2009, 12:57:06 AM (15 years ago)
- Location:
- code/branches/presentation2/src/orxonox/worldentities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.cc
r6108 r6112 50 50 51 51 registerMemberNetworkFunction( ControllableEntity, fire ); 52 registerMemberNetworkFunction( ControllableEntity, setTargetInternal ); 52 53 53 54 ControllableEntity::ControllableEntity(BaseObject* creator) : MobileEntity(creator) … … 232 233 callMemberNetworkFunction(ControllableEntity, fire, this->getObjectID(), 0, firemode); 233 234 } 235 } 236 237 void ControllableEntity::setTarget( WorldEntity* target ) 238 { 239 this->target_ = target; 240 if ( !GameMode::isMaster() ) 241 { 242 if ( target != 0 ) 243 { 244 callMemberNetworkFunction(ControllableEntity, setTargetInternal, this->getObjectID(), 0, target->getObjectID() ); 245 } 246 else 247 { 248 callMemberNetworkFunction(ControllableEntity, setTargetInternal, this->getObjectID(), 0, OBJECTID_UNKNOWN ); 249 } 250 } 251 } 252 253 void ControllableEntity::setTargetInternal( uint32_t targetID ) 254 { 255 this->setTarget( orxonox_cast<WorldEntity*>(Synchronisable::getSynchronisable(targetID)) ); 234 256 } 235 257 -
code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.h
r6111 r6112 146 146 { this->controller_ = val; } 147 147 148 virtual void setTarget( WorldEntity* target ) 149 { this->target_ = target; } 148 virtual void setTarget( WorldEntity* target ); 150 149 virtual WorldEntity* getTarget() 151 150 { return this->target_.get(); } 151 void setTargetInternal( uint32_t targetID ); 152 152 153 153 protected: -
code/branches/presentation2/src/orxonox/worldentities/pawns/Pawn.cc
r6111 r6112 119 119 registerVariable(this->initialHealth_, VariableDirection::ToClient); 120 120 registerVariable(this->bReload_, VariableDirection::ToServer); 121 registerVariable(this->aimPosition_, Bidirectionality::ServerMaster, 0, true); 121 122 } 122 123
Note: See TracChangeset
for help on using the changeset viewer.