Skip to content

Commit cb928f1

Browse files
refactor 1
1 parent f182db2 commit cb928f1

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

Shared/mods/deathmatch/logic/CLodModels.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,3 +491,22 @@ std::unique_ptr<const std::map<std::uint32_t, std::uint32_t>> CLodModels::LOD_MO
491491
{8255, 8159}, {8253, 8252}, {8249, 8248}, {8245, 8025}, {8219, 8222}, {8217, 8223}, {8215, 8226}, {7450, 7814}, {7482, 7771},
492492
{7514, 7680}, {7546, 7732}, {8213, 8224}, {8201, 8239}, {5511, 5557}, {5503, 5534}
493493
});
494+
495+
496+
std::uint32_t CLodModels::GetObjectLODModel(std::uint32_t objectID)
497+
{
498+
const auto it = LOD_MODELS->find(objectID);
499+
if (it != LOD_MODELS->end())
500+
return it->second;
501+
return 0;
502+
}
503+
504+
std::uint32_t CLodModels::GetObjectModelOfLOD(std::uint32_t lodModelID)
505+
{
506+
for (const auto& [objectID, lodModel] : *LOD_MODELS)
507+
{
508+
if (lodModel == lodModelID)
509+
return objectID;
510+
}
511+
return 0;
512+
}

Shared/mods/deathmatch/logic/CLodModels.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,8 @@
1515
class CLodModels
1616
{
1717
public:
18-
static std::uint32_t GetObjectLODModel(std::uint32_t objectID)
19-
{
20-
const auto it = LOD_MODELS->find(objectID);
21-
if (it != LOD_MODELS->end())
22-
{
23-
return it->second;
24-
}
25-
return 0;
26-
};
18+
static std::uint32_t GetObjectLODModel(std::uint32_t objectID);
19+
static std::uint32_t GetObjectModelOfLOD(std::uint32_t lodModelID);
2720

2821
private:
2922
// Static pointer to a map that is initialized in the .cpp file

0 commit comments

Comments
 (0)