mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Added all public headers to CMake projects, also moved some files around in the public directory. Translation units have been moved to the libraries that were responsible for implementing them, as this game is monolithic.
42 lines
971 B
C++
42 lines
971 B
C++
#include "core/stdafx.h"
|
|
#include "public/dt_common.h"
|
|
#include "public/datamap.h"
|
|
|
|
// [ PIXIE ]: Should work out of box when you pass proper datamap.
|
|
typedescription_t* DataMapHandler::FindFieldInDataMap(datamap_t* map, const string& fieldName)
|
|
{
|
|
while (map)
|
|
{
|
|
for (int i = 0; i < map->dataNumFields; i++)
|
|
{
|
|
string descFieldName = map->dataDesc[i].fieldName;
|
|
if (descFieldName.empty())
|
|
continue;
|
|
|
|
if (descFieldName.compare(fieldName) == 0)
|
|
return &map->dataDesc[i];
|
|
|
|
if (map->dataDesc[i].fieldType == 10) // FIELD_EMBEDDED
|
|
{
|
|
if (map->dataDesc[i].td)
|
|
{
|
|
typedescription_t* field = FindFieldInDataMap(map->dataDesc[i].td, fieldName);
|
|
if (field)
|
|
return field;
|
|
}
|
|
}
|
|
}
|
|
map = map->baseMap;
|
|
}
|
|
|
|
return nullptr;
|
|
}
|
|
|
|
int DataMapHandler::FindOffsetForField(datamap_t* map, const string& fieldName)
|
|
{
|
|
typedescription_t* field = FindFieldInDataMap(map, fieldName);
|
|
if (field)
|
|
return field->fieldOffset;
|
|
|
|
return 0;
|
|
} |