Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6752


Ignore:
Timestamp:
Apr 19, 2010, 9:37:18 AM (15 years ago)
Author:
rgrieder
Message:

Fixed PickupManager::getPawn() method against NULL pointers.
(Doesn't fix the issue I currently have though!)

File:
1 edited

Legend:

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

    r6746 r6752  
    152152    PickupCarrier* PickupManager::getPawn(void)
    153153    {
    154         Pawn* pawn = dynamic_cast<Pawn*>(GUIManager::getInstance().getPlayer(PickupManager::guiName_s)->getControllableEntity());
    155         if(pawn == NULL)
     154        PlayerInfo* player = GUIManager::getInstance().getPlayer(PickupManager::guiName_s);
     155        if (player != NULL)
     156            return dynamic_cast<PickupCarrier*>(player->getControllableEntity());
     157        else
    156158            return NULL;
    157         return dynamic_cast<PickupCarrier*>(pawn);
    158159    }
    159160   
Note: See TracChangeset for help on using the changeset viewer.