Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 4, 2011, 4:53:58 PM (14 years ago)
Author:
sven
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/dockingsystem/src/modules/docking/Dock.cc

    r8188 r8192  
    3333
    3434#include "Dock.h"
     35#include "infos/HumanPlayer.h"
    3536#include "worldentities/pawns/Pawn.h"
    3637#include "interfaces/PlayerTrigger.h"
     
    7273    bool Dock::execute(bool bTriggered, BaseObject* trigger)
    7374    {
    74         COUT(0) << "Dock executed (bTriggered = " << (bTriggered? "true":"false") << ").." << std::endl;
    75 
    76         //TODO: Handle MultiDistanceTrigger
     75        //TODO: Handle DistanceMultiTrigger
    7776
    7877        PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
     
    8382        {
    8483            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;
     84                COUT(0) << "Docking:execute PlayerTrigger was not triggered by a player.." << std::endl;
    8685                return false;
    8786            }
     
    9392        if(pawn == NULL)
    9493        {
    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;
    9695            return false;
    9796        }
     
    106105
    107106        // Try to get HumanPlayer
    108         HumanPlayer* human;
    109         if(!player->isHuman()) {
     107        if(!player->isHumanPlayer()) {
    110108            COUT(0) << "Docking::execute Not triggered by a human." << std::endl;
    111109            return false;
    112110        }
    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;
    117116
    118117        //TODO: This is waaay too oversimplified
    119118        if(bTriggered) {
    120119            DockingEffect::invokeEffect(docking::DOCKING, player, effects_);
    121             DockingEffect::invokeEffect(docking::ATTACH, player, effects_);
     120            //DockingEffect::invokeEffect(docking::ATTACH, player, effects_);
    122121        } else {
    123122            DockingEffect::invokeEffect(docking::RELEASE, player, effects_);
Note: See TracChangeset for help on using the changeset viewer.