MCPcopy Create free account
hub / github.com/Farama-Foundation/ViZDoom / SF_StartScript

Method SF_StartScript

src/vizdoom/src/fragglescript/t_func.cpp:4536–4567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4534//==========================================================================
4535
4536void FParser::SF_StartScript()
4537{
4538 if(t_argc != 1)
4539 {
4540 script_error("incorrect arguments to function\n");
4541 return;
4542 }
4543
4544 int snum = intvalue(t_argv[0]);
4545
4546 if(snum < 0 || snum >= MAXSCRIPTS)
4547 {
4548 script_error("script number %d out of range\n",snum);
4549 return;
4550 }
4551
4552 DFraggleThinker *th = DFraggleThinker::ActiveThinker;
4553 if (th)
4554 {
4555
4556 DFsScript *script = th->LevelScript->children[snum];
4557
4558 if(!script)
4559 {
4560 script_error("script %i not defined\n", snum);
4561 }
4562
4563 DRunningScript *runscr = new DRunningScript(Script->trigger, script, 0);
4564 // hook into chain at start
4565 th->AddRunningScript(runscr);
4566 }
4567}
4568
4569//==========================================================================
4570//

Callers

nothing calls this directly

Calls 3

script_errorFunction · 0.85
intvalueFunction · 0.85
AddRunningScriptMethod · 0.80

Tested by

no test coverage detected