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

Method SpawnRocket

ogsr_engine/xrGame/RocketLauncher.cpp:21–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19void CRocketLauncher::Load(LPCSTR section) { m_fLaunchSpeed = pSettings->r_float(section, "launch_speed"); }
20
21void CRocketLauncher::SpawnRocket(LPCSTR rocket_section, CGameObject* parent_rocket_launcher)
22{
23 CSE_Abstract* D = F_entity_Create(rocket_section);
24 R_ASSERT(D);
25 CSE_Temporary* l_tpTemporary = smart_cast<CSE_Temporary*>(D);
26 R_ASSERT(l_tpTemporary);
27 l_tpTemporary->m_tNodeID = parent_rocket_launcher->ai_location().level_vertex_id();
28 // Fill
29 D->s_name = rocket_section;
30 D->set_name_replace("");
31
32 D->s_gameid = u8(GameID());
33 D->s_RP = 0xff;
34 D->ID = 0xffff;
35 D->ID_Parent = parent_rocket_launcher->ID();
36 D->ID_Phantom = 0xffff;
37 D->s_flags.assign(M_SPAWN_OBJECT_LOCAL);
38 D->RespawnTime = 0;
39
40 // Send
41 NET_Packet P;
42 D->Spawn_Write(P, TRUE);
43 Level().Send(P, net_flags(TRUE));
44 // Destroy
45 F_entity_Destroy(D);
46}
47
48void CRocketLauncher::AttachRocket(u16 rocket_id, CGameObject* parent_rocket_launcher)
49{

Callers

nothing calls this directly

Calls 8

F_entity_CreateFunction · 0.85
GameIDFunction · 0.85
net_flagsFunction · 0.85
F_entity_DestroyFunction · 0.85
Spawn_WriteMethod · 0.80
level_vertex_idMethod · 0.45
assignMethod · 0.45
SendMethod · 0.45

Tested by

no test coverage detected