Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9406 in orxonox.OLD for trunk/src/world_entities/script_trigger.cc


Ignore:
Timestamp:
Jul 24, 2006, 11:09:47 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the proxy back

merged with commandsvn merge -r9346:HEAD https://svn.orxonox.net/orxonox/branches/proxy .

no conflicts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/script_trigger.cc

    r9298 r9406  
    6363  addToScript = false;
    6464  this->activeOnCreation = false;
    65  
     65
    6666  if(root != NULL)
    6767  {
    68    
     68
    6969    loadParams(root);
    70  
     70
    7171    if(addToScript && scriptIsOk)
    7272    {
    7373      script->addObject( "ScriptTrigger", this->getName());
    7474    }
    75  
    76   }
    77  
     75
     76  }
     77
    7878}
    7979
    8080/**
    8181 * Deletes the ScriptTrigger.
    82  * 
     82 *
    8383 */
    8484ScriptTrigger::~ScriptTrigger()
     
    147147  else
    148148  {
    149     PRINTF(2)("Target %s for %s::%s does not Exist\n", target.c_str(), this->getClassName(), this->getName());
     149    PRINTF(2)("Target %s for %s::%s does not Exist\n", target.c_str(), this->getClassCName(), this->getCName());
    150150  }
    151151}
     
    153153/**
    154154 * Sets the parent of the trigger.
    155  * @param parent The parrent. 
     155 * @param parent The parrent.
    156156 */
    157157void ScriptTrigger::setTriggerParent(const std::string& parent)
     
    166166  else
    167167  {
    168     PRINTF(2)("Parent %s for %s::%s does not Exist\n", parent.c_str(), this->getClassName(), this->getName());
     168    PRINTF(2)("Parent %s for %s::%s does not Exist\n", parent.c_str(), this->getClassCName(), this->getCName());
    169169  }
    170170}
     
    179179     return;
    180180   }
    181    
     181
    182182  if(triggerRemains && scriptCalled)
    183183  {
     
    185185    return;
    186186  }
    187  
     187
    188188  if( !invert && this->distance(target) < radius)
    189189  {
     
    191191    scriptCalled = true;
    192192    return;
    193  
     193
    194194  }
    195195  else if( invert && this->distance(target) > radius)
    196196  {
    197     executeAction(timestep); 
     197    executeAction(timestep);
    198198    scriptCalled = true;
    199199    return;
     
    207207void ScriptTrigger::executeAction(float timestep)
    208208{
    209  
     209
    210210  if(scriptIsOk)
    211211  {
     
    213213    if(!(script->selectFunction(this->functionName,returnCount)) )
    214214      PRINT(1)("Error ScriptTrigger: Selection of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str());
    215      
     215
    216216    script->pushParam( timestep, this->functionName);
    217      
     217
    218218    if( !(script->executeFunction()) )
    219219      PRINT(1)("Error ScriptTrigger: Execution of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str());
    220      
     220
    221221    scriptFinished = script->getReturnedBool();
    222222  }
    223      
    224      
     223
     224
    225225}
    226226
     
    268268   float retf = script->getReturnedFloat();
    269269   printf("main returned %f\n",retf);
    270    
     270
    271271
    272272   printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));
Note: See TracChangeset for help on using the changeset viewer.