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

Method Execute

ogsr_engine/xrGame/console_commands.cpp:577–608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

575 CCC_ALifeLoadFrom(LPCSTR N) : IConsole_Command(N) { bEmptyArgsHandled = true; }
576
577 void Execute(LPCSTR args) override
578 {
579 if (!CSavedGameWrapper::valid_saved_game(args))
580 {
581 Msg("! Cannot load saved game [%s]: not found or version mismatch or corrupted", args ? args : "nullptr");
582 return;
583 }
584
585 if (ai().get_alife())
586 {
587 if (MainMenu()->IsActive())
588 MainMenu()->Activate(false);
589
590 Console->Hide();
591
592 ::Sound->set_master_volume(0.f);
593
594 if (Device.Paused())
595 Device.Pause(FALSE, TRUE, TRUE, "CCC_ALifeLoadFrom");
596
597 NET_Packet net_packet;
598 net_packet.w_begin(M_LOAD_GAME);
599 net_packet.w_stringZ(args);
600 Level().Send(net_packet, net_flags(TRUE));
601 }
602 else
603 {
604 string_path command;
605 xr_strconcat(command, "start server(", args, "/single/alife/load)");
606 Console->Execute(command);
607 }
608 }
609
610 virtual void fill_tips(vecTips& tips, u32 mode) { get_files_list(tips, "$game_saves$", SAVE_EXTENSION); }
611};

Callers

nothing calls this directly

Calls 15

MsgFunction · 0.85
MainMenuFunction · 0.85
net_flagsFunction · 0.85
xr_strconcatFunction · 0.85
get_alifeMethod · 0.80
set_master_volumeMethod · 0.80
PausedMethod · 0.80
w_beginMethod · 0.80
w_stringZMethod · 0.80
IsActiveMethod · 0.45
ActivateMethod · 0.45
HideMethod · 0.45

Tested by

no test coverage detected