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

Method OnSimulate

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

Source from the content-addressed store, hash-verified

510}
511
512bool 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
535GameValue Script::VarGet(const char* name) const
536{

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected