Changeset 11708 for code/trunk/src/modules/pickup/PickupManager.cc
- Timestamp:
- Jan 6, 2018, 6:07:53 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/pickup/PickupManager.cc
r11704 r11708 301 301 if(GameMode::isStandalone() || Host::getPlayerID() == clientId) 302 302 { 303 // If there is no PickupRepresentation registered the default representation is used. 304 if(this->representations_.find(pickup->getRepresentationName()) == this->representations_.end()) 305 PickupManager::pickupChangedPickedUpNetwork(index, pickup->isUsable(), this->defaultRepresentation_->getObjectID(), pickup->getRepresentationName(), pickedUp); 306 else 307 PickupManager::pickupChangedPickedUpNetwork(index, pickup->isUsable(), this->representations_[pickup->getRepresentationName()]->getObjectID(), pickup->getRepresentationName(), pickedUp); 303 PickupManager::pickupChangedPickedUpNetwork(index, pickup->isUsable(), pickup->getRepresentationName(), pickedUp, pawn->getObjectID()); 308 304 } 309 305 // If the concerned host is somewhere in the network, we call pickupChangedPickedUpNetwork() on its PickupManager. 310 306 else 311 307 { 312 // If there is no PickupRepresentation registered the default representation is used. 313 if(this->representations_.find(pickup->getRepresentationName()) == this->representations_.end()) 314 { 315 callStaticNetworkFunction(&PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->defaultRepresentation_->getObjectID(), pickedUp); 316 } 317 else 318 { 319 callStaticNetworkFunction(&PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->representations_[pickup->getRepresentationName()]->getObjectID(), pickedUp); 320 } 308 callStaticNetworkFunction(&PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), pickedUp, pawn->getObjectID()); 321 309 } 322 310 … … 332 320 @param usable 333 321 Whether the Pickupable's used status can be changed to used in the PickupInventory. 334 @param representationObjectId335 The objectId identifying (over the network) the PickupRepresentation that represents this Pickupable.336 322 @param representationName 337 323 The name of the associated PickupRepresentation 338 324 @param pickedUp 339 325 The pickedUp status the Pickupable changed to. 340 */ 341 /*static*/ void PickupManager::pickupChangedPickedUpNetwork(uint32_t pickup, bool usable, uint32_t representationObjectId, const std::string& representationName, bool pickedUp) 326 @param carrierPawnId 327 The objectId identifier (over the network) the Pawn that carries this Pickupable 328 */ 329 /*static*/ void PickupManager::pickupChangedPickedUpNetwork(uint32_t pickup, bool usable, const std::string& representationName, bool pickedUp, uint32_t carrierPawnId) 342 330 { 343 331 PickupManager& manager = PickupManager::getInstance(); // Get the PickupManager singleton on this host. … … 352 340 container->usable = usable; 353 341 container->unusable = false; 354 container->representationObjectId = representationObjectId;355 342 container->representationName = representationName; 343 container->carrierPawnId = carrierPawnId; 356 344 // Insert the container into the pickupInventoryContainers_ list. 357 345 manager.pickupInventoryContainers_.insert(std::pair<uint32_t, PickupInventoryContainer*>(pickup, container));
Note: See TracChangeset
for help on using the changeset viewer.