Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 29, 2011, 6:44:45 PM (13 years ago)
Author:
dafrick
Message:

Possible fix for segfaults due to player being NULL.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/modules/questsystem/QuestEffectBeacon.cc

    r8351 r8667  
    113113
    114114        PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
    115         Pawn* pawn = NULL;
     115        PlayerInfo* player = NULL;
    116116
    117117        // If the trigger is a PlayerTrigger.
     
    121121                return false;
    122122            else
    123                 pawn = pTrigger->getTriggeringPlayer();
     123                player = pTrigger->getTriggeringPlayer();
    124124        }
    125125        else
    126126            return false;
    127127
    128         if(pawn == NULL)
     128        if(player == NULL)
    129129        {
    130130            COUT(4) << "The QuestEffectBeacon was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << std::endl;
    131             return false;
    132         }
    133 
    134         // Extract the PlayerInfo from the Pawn.
    135         PlayerInfo* player = pawn->getPlayer();
    136 
    137         if(player == NULL)
    138         {
    139             COUT(3) << "The PlayerInfo* is NULL." << std::endl;
    140131            return false;
    141132        }
Note: See TracChangeset for help on using the changeset viewer.