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

Function LoadAIObjects

TombEngine/Specific/level.cpp:1301–1326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1299}
1300
1301void LoadAIObjects()
1302{
1303 int aiObjectCount = ReadCount();
1304 TENLog("AI object count: " + std::to_string(aiObjectCount), LogLevel::Info);
1305
1306 g_Level.AIObjects.reserve(aiObjectCount);
1307 for (int i = 0; i < aiObjectCount; i++)
1308 {
1309 auto& obj = g_Level.AIObjects.emplace_back();
1310
1311 obj.objectNumber = (GAME_OBJECT_ID)ReadInt16();
1312 obj.roomNumber = ReadInt16();
1313 obj.pos.Position.x = ReadInt32();
1314 obj.pos.Position.y = ReadInt32();
1315 obj.pos.Position.z = ReadInt32();
1316 obj.pos.Orientation.y = ReadInt16();
1317 obj.pos.Orientation.x = ReadInt16();
1318 obj.pos.Orientation.z = ReadInt16();
1319 obj.triggerFlags = ReadInt16();
1320 obj.flags = ReadInt16();
1321 obj.boxNumber = ReadInt32();
1322 obj.Name = ReadString();
1323
1324 g_GameScriptEntities->AddName(obj.Name, obj);
1325 }
1326}
1327
1328void LoadEvent(EventSet& eventSet)
1329{

Callers 1

LoadLevelFunction · 0.85

Calls 9

ReadCountFunction · 0.85
TENLogFunction · 0.85
to_stringFunction · 0.85
ReadInt16Function · 0.85
ReadInt32Function · 0.85
ReadStringFunction · 0.85
emplace_backMethod · 0.80
AddNameMethod · 0.80
reserveMethod · 0.45

Tested by

no test coverage detected