Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 12, 2008, 2:28:46 PM (16 years ago)
Author:
dafrick
Message:

Some more stuff on Triggers…

Location:
code/branches/questsystem2/src/orxonox/objects/quest
Files:
2 edited

Legend:

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

    r2193 r2195  
    3232#include "core/CoreIncludes.h"
    3333#include "core/XMLPort.h"
     34#include "core/Event.h"
    3435#include "core/EventIncludes.h"
    3536
     
    4950        this->times_ = -1;
    5051        this->trigger_ = NULL;
     52        this->player_ = NULL;
    5153    }
    5254
     
    6769    {
    6870        SetSubclassEvent(QuestEffectBeacon, "execute", execute, event, PlayerTrigger);
     71       
     72        this->player_ = dynamic_cast<ControllableEntity*>(event.originator_);
    6973    }
    7074   
    71     bool QuestEffectBeacon::execute(ControllableEntity* player)
     75    bool QuestEffectBeacon::execute(void)
    7276    {
     77       
    7378        if(!(this->isActive()))
    7479        {
    7580            return false;
    7681        }
    77         if(player == NULL)
     82        if(this->player_ == NULL)
    7883        {
    7984            return false;
    8085        }
    8186       
    82         bool check = QuestEffect::invokeEffects(player, this->effects_);
     87        bool check = QuestEffect::invokeEffects(this->player_, this->effects_);
    8388        if(check)
    8489        {
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.h

    r2193 r2195  
    6363            virtual void processEvent(Event& event);
    6464           
    65             bool execute(ControllableEntity* player);
     65            bool execute(void);
    6666           
    6767            bool isActive(void);
     
    7878            QuestEffectBeaconStatus::Enum status_;
    7979            PlayerTrigger* trigger_;
     80            ControllableEntity* player_;
    8081           
    8182            bool setTimes(const int & n);
Note: See TracChangeset for help on using the changeset viewer.