Changeset 8188 for code/branches/dockingsystem/src
- Timestamp:
- Apr 4, 2011, 3:48:17 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/dockingsystem/src/modules/docking/Dock.cc
r8186 r8188 79 79 Pawn* pawn = NULL; 80 80 81 // If the trigger is a PlayerTrigger.81 // Check whether it is a player trigger and extract pawn from it 82 82 if(pTrigger != NULL) 83 83 { 84 if(!pTrigger->isForPlayer()) // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one. 84 if(!pTrigger->isForPlayer()) { // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one. 85 COUT(0) << "Docking:execute PlayerTrigger is not triggered for player.." << std::endl; 85 86 return false; 86 else 87 pawn = pTrigger->getTriggeringPlayer(); 87 } 88 pawn = pTrigger->getTriggeringPlayer(); 89 } else { 90 COUT(0) << "Docking::execute Not a player trigger, can't extract pawn from it.." << std::endl; 91 return false; 88 92 } 89 else90 return false;91 92 93 if(pawn == NULL) 93 94 { 94 COUT( 4) << "Docking: Can't retrieve Pawn from Trigger. (" << trigger->getIdentifier()->getName() << ")" << std::endl;95 COUT(0) << "Docking: Can't retrieve Pawn from Trigger. (" << trigger->getIdentifier()->getName() << ")" << std::endl; 95 96 return false; 96 97 } … … 98 99 // Extract the PlayerInfo from the Pawn. 99 100 PlayerInfo* player = pawn->getPlayer(); 100 101 101 if(player == NULL) 102 102 { 103 COUT( 3) << "The PlayerInfo* is NULL." << std::endl;103 COUT(0) << "The PlayerInfo* is NULL." << std::endl; 104 104 return false; 105 105 } 106 106 107 //TODO: This is way too oversimplified 107 // Try to get HumanPlayer 108 HumanPlayer* human; 109 if(!player->isHuman()) { 110 COUT(0) << "Docking::execute Not triggered by a human." << std::endl; 111 return false; 112 } 113 human = orxonox_cast<HumanPlayer*>(player); 114 assert(human); 115 116 117 118 //TODO: This is waaay too oversimplified 108 119 if(bTriggered) { 109 120 DockingEffect::invokeEffect(docking::DOCKING, player, effects_);
Note: See TracChangeset
for help on using the changeset viewer.