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/objects/Script.cc

    r7493 r8667  
    140140
    141141        PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
    142         Pawn* pawn = NULL;
     142        PlayerInfo* player = NULL;
    143143
    144144        // If the trigger is a PlayerTrigger.
     
    148148                return false;
    149149            else
    150                 pawn = pTrigger->getTriggeringPlayer();
     150                player = pTrigger->getTriggeringPlayer();
    151151        }
    152152        else
    153153            return false;
    154154
    155         if(pawn == NULL)  //TODO: Will this ever happen? If not, change in NotificationDispatcher as well.
     155        if(player == NULL)  //TODO: Will this ever happen? If not, change in NotificationDispatcher as well.
    156156        {
    157157            COUT(4) << "The Script was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << std::endl;
    158             return false;
    159         }
    160 
    161         // Extract the PlayerInfo from the Pawn.
    162         PlayerInfo* player = pawn->getPlayer();
    163 
    164         if(player == NULL)
    165         {
    166             COUT(3) << "The PlayerInfo* is NULL." << std::endl;
    167158            return false;
    168159        }
Note: See TracChangeset for help on using the changeset viewer.