Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2209


Ignore:
Timestamp:
Nov 14, 2008, 2:55:55 PM (16 years ago)
Author:
dafrick
Message:

Resolved some issues with triggers.

Location:
code/branches/questsystem2/src/orxonox/objects
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem2/src/orxonox/objects/quest/AddQuest.cc

    r2205 r2209  
    9292        }
    9393
     94        COUT(3) << "AddQuest on player: " << player << " ." << std::endl;
     95
    9496        try
    9597        {
     
    106108        }
    107109
    108         COUT(3) << "Quest {" << this->getQuestId() << "} successfully added to player." << std::endl;
     110        COUT(3) << "Quest {" << this->getQuestId() << "} successfully added to player." << std::endl;
    109111        return true;
    110112    }
  • code/branches/questsystem2/src/orxonox/objects/quest/CompleteQuest.cc

    r2205 r2209  
    8989        }
    9090
     91        COUT(3) << "CompleteQuest on player: " << player << " ." << std::endl;
     92
     93        Quest* quest;
     94
    9195        try
    9296        {
    93             Quest* quest = QuestManager::findQuest(this->getQuestId());
     97            quest = QuestManager::findQuest(this->getQuestId());
    9498            if(!quest->complete(player))
    9599            {
     
    103107        }
    104108
     109        COUT(3) << "Quest {" << quest->getId() << "} successfully completed by player: " << player << " ." << std::endl;
    105110        return true;
    106111    }
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.cc

    r2208 r2209  
    7171    }
    7272   
    73     bool QuestEffectBeacon::execute(bool b, ControllableEntity* entity)
    74     {
    75         if(!b || !(this->isActive()))
     73    bool QuestEffectBeacon::execute(bool b, PlayerTrigger* trigger)
     74    {
     75        if(!b)
     76        {
     77            COUT(2) << "b is false." << std::endl;
     78        }
     79        if(!(this->isActive()))
    7680        {
    7781            COUT(3) << "The QuestEffectBeacon is inactive." << std::endl;
    7882            return false;
    7983        }
     84
     85        ControllableEntity* entity = trigger->getTriggeringPlayer();
     86
    8087        if(entity == NULL)
    8188        {
     
    9198            return false;
    9299        }
    93        
     100
     101        COUT(3) << "QuestEffectBeacon executed on player: " << player << " ." << std::endl;       
     102
    94103        bool check = QuestEffect::invokeEffects(player, this->effects_);
    95104        if(check)
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.h

    r2208 r2209  
    6565            virtual void processEvent(Event& event);
    6666           
    67             bool execute(bool b, ControllableEntity* player); //!< Executes the QuestEffects of the QuestEffectBeacon.
     67            bool execute(bool b, PlayerTrigger* trigger); //!< Executes the QuestEffects of the QuestEffectBeacon.
    6868           
    6969            bool isActive(void); //!< Test whether the QuestEffectBeacon is active.
  • code/branches/questsystem2/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc

    r2206 r2209  
    141141    if (Trigger::isTriggered(mode))
    142142    {
    143         COUT(3) << "Triggers" << std::endl;
    144143      return checkDistance();
    145144    }
Note: See TracChangeset for help on using the changeset viewer.