| 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 | { |
nothing calls this directly
no test coverage detected