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/notifications/NotificationDispatcher.cc

    r8666 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)
     155        if(player == NULL)
    156156        {
    157157            COUT(4) << "The NotificationDispatcher was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << std::endl;
     
    159159        }
    160160
    161         // Extract the PlayerInfo from the Pawn.
    162         PlayerInfo* player = pawn->getPlayer();
    163 
    164         if(player == NULL)
    165         {
    166             CCOUT(3) << "The PlayerInfo* is NULL." << std::endl;
    167             return false;
    168         }
    169 
    170         // HACK fix. Resolve this issue another way...
    171         if(GameMode::isStandalone())
    172             this->dispatch(0);
    173         else
    174             this->dispatch(player->getClientID());
     161        this->dispatch(player->getClientID());
    175162
    176163        return true;
Note: See TracChangeset for help on using the changeset viewer.