MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / OnEvent

Method OnEvent

ogsr_engine/xrGame/GamePersistent.cpp:645–670  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

643#include "xrServer.h"
644
645void CGamePersistent::OnEvent(EVENT E, u64 P1, u64 P2)
646{
647 if (E == eQuickLoad)
648 {
649 if (Device.Paused())
650 Device.Pause(FALSE, TRUE, TRUE, "eQuickLoad");
651
652 LPSTR saved_name = (LPSTR)(P1);
653
654 Level().remove_objects();
655 game_sv_Single* game = smart_cast<game_sv_Single*>(Level().Server->game);
656 R_ASSERT(game);
657 game->restart_simulator(saved_name);
658 xr_free(saved_name);
659 return;
660 }
661 else if (E == eDemoStart)
662 {
663 string256 cmd;
664 LPCSTR demo = LPCSTR(P1);
665 sprintf_s(cmd, "demo_play %s", demo);
666 Console->Execute(cmd);
667 xr_free(demo);
668 uTime2Change = Device.TimerAsync() + u32(P2) * 1000;
669 }
670}
671
672void CGamePersistent::Statistics(CGameFont* F)
673{

Callers

nothing calls this directly

Calls 7

xr_freeFunction · 0.85
PausedMethod · 0.80
remove_objectsMethod · 0.80
restart_simulatorMethod · 0.80
u32Enum · 0.70
PauseMethod · 0.45
ExecuteMethod · 0.45

Tested by

no test coverage detected