Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 29, 2007, 5:50:50 PM (18 years ago)
Author:
snellen
Message:

space trigger should work now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/scriptimprovements/src/world_entities/script_triggers/space_trigger.cc

    r10607 r10608  
    116116void SpaceTrigger::tick(float timestep)
    117117{
     118  if( this->getScriptFinished() ) return;
    118119
     120  if(triggerRemains && this->getScriptCalled() )
     121  {
     122    executeAction(timestep);
     123    return;
     124  }
     125
     126  if( this->target != NULL)
     127  {
     128    if( !invert && this->distance(target) < radius)
     129    {
     130    //printf("Distance is %f \n", this->distance(target));
     131      executeAction(timestep);
     132      this->setScriptCalled(true);
     133      return;
     134
     135    }
     136    else if( invert && this->distance(target) > radius)
     137    {
     138      executeAction(timestep);
     139      this->setScriptCalled(true);
     140      return;
     141    }
     142  }
    119143}
    120144
Note: See TracChangeset for help on using the changeset viewer.