| 510 | } |
| 511 | |
| 512 | bool Script::OnSimulate() |
| 513 | { |
| 514 | if (CurrentScript) |
| 515 | { |
| 516 | return false; |
| 517 | } |
| 518 | bool ret = false; |
| 519 | _time = Glob.time - _baseTime; |
| 520 | if (_time >= _suspendedUntil) |
| 521 | { |
| 522 | CurrentScript = this; |
| 523 | GameState* gstate = GWorld->GetGameState(); |
| 524 | gstate->BeginContext(&_vars); |
| 525 | gstate->VarSet("_time", _time); |
| 526 | ret = SimulateBody(); |
| 527 | _time = gstate->VarGet("_time"); |
| 528 | _baseTime = Glob.time - _time; |
| 529 | gstate->EndContext(); |
| 530 | CurrentScript = nullptr; |
| 531 | } |
| 532 | return ret; |
| 533 | } |
| 534 | |
| 535 | GameValue Script::VarGet(const char* name) const |
| 536 | { |
nothing calls this directly
no test coverage detected