MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / InitializeRope

Function InitializeRope

TombEngine/Objects/Generic/Object/rope.cpp:27–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25 int RopeSwing = 0;
26
27 void InitializeRope(short itemNumber)
28 {
29 auto* item = &g_Level.Items[itemNumber];
30 short roomNumber = item->RoomNumber;
31
32 auto itemPos = item->Pose.Position;
33
34 FloorInfo* floor = GetFloor(itemPos.x, itemPos.y, itemPos.z, &roomNumber);
35 itemPos.y = GetCeiling(floor, itemPos.x, itemPos.y, itemPos.z);
36
37 auto pos = Vector3i(0, 16384, 0);
38 ROPE_STRUCT rope;
39 PrepareRope(&rope, &itemPos, &pos, CLICK(0.5f), item);
40
41 item->TriggerFlags = short(Ropes.size());
42
43 Ropes.push_back(rope);
44 }
45
46 void PrepareRope(ROPE_STRUCT* rope, Vector3i* pos1, Vector3i* pos2, int length, ItemInfo* item)
47 {

Callers

nothing calls this directly

Calls 6

GetFloorFunction · 0.85
GetCeilingFunction · 0.85
PrepareRopeFunction · 0.85
Vector3iClass · 0.70
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected