Changeset 8192 for code/branches/dockingsystem/src/modules
- Timestamp:
- Apr 4, 2011, 4:53:58 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/dockingsystem/src/modules/docking/Dock.cc
r8188 r8192 33 33 34 34 #include "Dock.h" 35 #include "infos/HumanPlayer.h" 35 36 #include "worldentities/pawns/Pawn.h" 36 37 #include "interfaces/PlayerTrigger.h" … … 72 73 bool Dock::execute(bool bTriggered, BaseObject* trigger) 73 74 { 74 COUT(0) << "Dock executed (bTriggered = " << (bTriggered? "true":"false") << ").." << std::endl; 75 76 //TODO: Handle MultiDistanceTrigger 75 //TODO: Handle DistanceMultiTrigger 77 76 78 77 PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger); … … 83 82 { 84 83 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 forplayer.." << std::endl;84 COUT(0) << "Docking:execute PlayerTrigger was not triggered by a player.." << std::endl; 86 85 return false; 87 86 } … … 93 92 if(pawn == NULL) 94 93 { 95 COUT(0) << "Docking: Can't retrieve Pawn from Trigger. (" << trigger->getIdentifier()->getName() << ")" << std::endl;94 COUT(0) << "Docking::execute Can't retrieve Pawn from Trigger. (" << trigger->getIdentifier()->getName() << ")" << std::endl; 96 95 return false; 97 96 } … … 106 105 107 106 // Try to get HumanPlayer 108 HumanPlayer* human; 109 if(!player->isHuman()) { 107 if(!player->isHumanPlayer()) { 110 108 COUT(0) << "Docking::execute Not triggered by a human." << std::endl; 111 109 return false; 112 110 } 113 human = orxonox_cast<HumanPlayer*>(player); 114 assert(human); 115 116 111 HumanPlayer* human = orxonox_cast<HumanPlayer*>(player); 112 if(human == NULL) { 113 COUT(0) << "Docking::execute Player was not as human as expected.." << std::endl; 114 } 115 COUT(0) << "Dock triggered by player: " << human->getNick() << ".." << std::endl; 117 116 118 117 //TODO: This is waaay too oversimplified 119 118 if(bTriggered) { 120 119 DockingEffect::invokeEffect(docking::DOCKING, player, effects_); 121 DockingEffect::invokeEffect(docking::ATTACH, player, effects_);120 //DockingEffect::invokeEffect(docking::ATTACH, player, effects_); 122 121 } else { 123 122 DockingEffect::invokeEffect(docking::RELEASE, player, effects_);
Note: See TracChangeset
for help on using the changeset viewer.