| 622 | //========================================================================== |
| 623 | |
| 624 | static bool RunScript(int snum, AActor * t_trigger) |
| 625 | { |
| 626 | DFraggleThinker *th = DFraggleThinker::ActiveThinker; |
| 627 | if (th) |
| 628 | { |
| 629 | // [CO] It is far too dangerous to start the script right away. |
| 630 | // Better queue it for execution for the next time |
| 631 | // the runningscripts are checked. |
| 632 | |
| 633 | if(snum < 0 || snum >= MAXSCRIPTS) return false; |
| 634 | |
| 635 | DFsScript *script = th->LevelScript->children[snum]; |
| 636 | if(!script) return false; |
| 637 | |
| 638 | DRunningScript *runscr = new DRunningScript(t_trigger, script, 0); |
| 639 | // hook into chain at start |
| 640 | th->AddRunningScript(runscr); |
| 641 | return true; |
| 642 | } |
| 643 | return false; |
| 644 | } |
| 645 | |
| 646 | //========================================================================== |
| 647 | // |
no test coverage detected