Changeset 10634 in orxonox.OLD for branches/inputdevice/src/world_entities/script_triggers/action_trigger.cc
- Timestamp:
- Apr 19, 2007, 11:45:56 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/inputdevice/src/world_entities/script_triggers/action_trigger.cc
r10632 r10634 17 17 #include "action_trigger.h" 18 18 #include "debug.h" 19 #include "event_handler.h" 19 20 20 21 ObjectListDefinition(ActionTrigger); … … 48 49 { 49 50 this->registerObject(this, ActionTrigger::_objectList); 51 this->subscribeEvent(ES_GAME, KeyMapper::PEV_ACTION); 50 52 51 53 radius = 10; … … 117 119 } 118 120 121 void ActionTrigger::process( const Event &event) 122 { 123 if (event.type == KeyMapper::PEV_ACTION && event.bPressed) 124 actionScheduled = true; 125 } 119 126 120 127 void ActionTrigger::tick( float timestep ) … … 128 135 executeScriptFunction(timestep); 129 136 scriptCalled = true; 130 return;131 137 } 132 138 else if( invert && this->distance(target) > radius && actionScheduled) … … 134 140 executeScriptFunction(timestep); 135 141 scriptCalled = true; 136 return;137 142 } 138 143 }
Note: See TracChangeset
for help on using the changeset viewer.