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/docking/Dock.cc

    r8645 r8667  
    8484    {
    8585        PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
    86         Pawn* pawn = NULL;
     86        PlayerInfo* player = NULL;
    8787
    8888        // Check whether it is a player trigger and extract pawn from it
     
    9393                return false;
    9494            }
    95             pawn = pTrigger->getTriggeringPlayer();
     95            player = pTrigger->getTriggeringPlayer();
    9696        }
    9797        else
     
    100100            return false;
    101101        }
    102         if(pawn == NULL)
    103         {
    104             COUT(4) << "Docking::execute Can't retrieve Pawn from Trigger. (" << trigger->getIdentifier()->getName() << ")" << std::endl;
    105             return false;
    106         }
    107 
    108         // Extract the PlayerInfo from the Pawn.
    109         PlayerInfo* player = pawn->getPlayer();
    110102        if(player == NULL)
    111103        {
    112             COUT(2) << "Docking::execute The PlayerInfo* is NULL." << std::endl;
     104            COUT(4) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << std::endl;
    113105            return false;
    114106        }
Note: See TracChangeset for help on using the changeset viewer.