| 488 | } |
| 489 | |
| 490 | bool Script::Simulate(float deltaT) |
| 491 | { |
| 492 | if (CurrentScript) |
| 493 | { |
| 494 | return false; |
| 495 | } |
| 496 | bool ret = false; |
| 497 | if (_time >= _suspendedUntil) |
| 498 | { |
| 499 | CurrentScript = this; |
| 500 | GameState* gstate = GWorld->GetGameState(); |
| 501 | gstate->BeginContext(&_vars); |
| 502 | gstate->VarSet("_time", _time); // make sure there is such variable |
| 503 | ret = SimulateBody(); |
| 504 | _time = gstate->VarGet("_time"); |
| 505 | gstate->EndContext(); |
| 506 | CurrentScript = nullptr; |
| 507 | } |
| 508 | _time += deltaT; |
| 509 | return ret; |
| 510 | } |
| 511 | |
| 512 | bool Script::OnSimulate() |
| 513 | { |
no test coverage detected