Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7531 for code


Ignore:
Timestamp:
Oct 12, 2010, 8:33:58 PM (14 years ago)
Author:
dafrick
Message:

Fixing bug, that caused segfault in pickups with multiplayer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/pickup/PickupManager.cc

    r7504 r7531  
    404404        if(GameMode::isStandalone() || Host::getPlayerID() == clientId)
    405405        {
    406             PickupManager::pickupChangedPickedUpNetwork(index, pickup->isUsable(), this->representations_[pickup->getPickupIdentifier()]->getObjectID(), pickedUp);
    407         }
    408         else
    409         {
    410             callStaticNetworkFunction(PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->representations_[pickup->getPickupIdentifier()]->getObjectID(), pickedUp);
     406            if(this->representations_.find(pickup->getPickupIdentifier()) == this->representations_.end())
     407                PickupManager::pickupChangedPickedUpNetwork(index, pickup->isUsable(), this->defaultRepresentation_->getObjectID(), pickedUp);
     408            else
     409                PickupManager::pickupChangedPickedUpNetwork(index, pickup->isUsable(), this->representations_[pickup->getPickupIdentifier()]->getObjectID(), pickedUp);
     410        }
     411        else
     412        {
     413            if(this->representations_.find(pickup->getPickupIdentifier()) == this->representations_.end())
     414            {
     415                callStaticNetworkFunction(PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->defaultRepresentation_->getObjectID(), pickedUp);
     416            }
     417            else
     418            {
     419                callStaticNetworkFunction(PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->representations_[pickup->getPickupIdentifier()]->getObjectID(), pickedUp);
     420            }
    411421        }
    412422
Note: See TracChangeset for help on using the changeset viewer.