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

Method Execute

ogsr_engine/xrGame/console_commands.cpp:996–1027  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

994 CCC_SpawnToInventory(LPCSTR N) : IConsole_Command(N) {}
995
996 void Execute(LPCSTR args)
997 {
998 if (!g_pGameLevel)
999 return;
1000
1001 if (!pSettings->section_exist(args))
1002 {
1003 Msg("! Can't find section: %s", args);
1004 return;
1005 }
1006
1007 if (auto tpGame = smart_cast<game_sv_Single*>(Level().Server->game))
1008 {
1009 NET_Packet packet;
1010 packet.w_begin(M_SPAWN);
1011 packet.w_stringZ(args);
1012
1013 CSE_Abstract* item =
1014 tpGame->alife().spawn_item(args, Actor()->Position(), Actor()->ai_location().level_vertex_id(), Actor()->ai_location().game_vertex_id(), 0, false);
1015 item->Spawn_Write(packet, FALSE);
1016 tpGame->alife().server().FreeID(item->ID, 0);
1017 F_entity_Destroy(item);
1018
1019 ClientID clientID;
1020 clientID.set(0xffff);
1021
1022 u16 dummy;
1023 packet.r_begin(dummy);
1024 VERIFY(dummy == M_SPAWN);
1025 tpGame->alife().server().Process_spawn(packet, clientID);
1026 }
1027 }
1028
1029 virtual void fill_tips(vecTips& tips, u32 mode)
1030 {

Callers

nothing calls this directly

Calls 15

MsgFunction · 0.85
ActorFunction · 0.85
F_entity_DestroyFunction · 0.85
section_existMethod · 0.80
w_beginMethod · 0.80
w_stringZMethod · 0.80
PositionMethod · 0.80
Spawn_WriteMethod · 0.80
FreeIDMethod · 0.80
Process_spawnMethod · 0.80
spawn_itemMethod · 0.45
level_vertex_idMethod · 0.45

Tested by

no test coverage detected