MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / Simulate

Method Simulate

engine/Poseidon/Game/Scripting/Scripts.cpp:490–510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

488}
489
490bool 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
512bool Script::OnSimulate()
513{

Callers 1

SetVisibilityFunction · 0.45

Calls 5

BeginContextMethod · 0.80
EndContextMethod · 0.80
GetGameStateMethod · 0.45
VarSetMethod · 0.45
VarGetMethod · 0.45

Tested by

no test coverage detected