mirror of
https://github.com/SWG-Source/src.git
synced 2026-09-11 23:45:01 -04:00
Track Original OID in Buildout Objects
This commit is contained in:
@@ -662,6 +662,7 @@ void ServerBuildoutManagerNamespace::loadArea(AreaInfo &areaInfo)
|
|||||||
|
|
||||||
std::set< int64 > objects;
|
std::set< int64 > objects;
|
||||||
|
|
||||||
|
int64 originalObjId = 0;
|
||||||
for (int buildoutRow = 0; buildoutRow < buildoutRowCount; ++buildoutRow)
|
for (int buildoutRow = 0; buildoutRow < buildoutRowCount; ++buildoutRow)
|
||||||
{
|
{
|
||||||
int64 objId = 0;
|
int64 objId = 0;
|
||||||
@@ -726,7 +727,8 @@ void ServerBuildoutManagerNamespace::loadArea(AreaInfo &areaInfo)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
objId = areaBuildoutTable.getIntValue(objIdColumn, buildoutRow);
|
originalObjId = areaBuildoutTable.getIntValue(objIdColumn, buildoutRow);
|
||||||
|
objId = originalObjId;
|
||||||
containerId = areaBuildoutTable.getIntValue(containerColumn, buildoutRow);
|
containerId = areaBuildoutTable.getIntValue(containerColumn, buildoutRow);
|
||||||
|
|
||||||
// with new buildout files, the object id is a random 31-bit negative value
|
// with new buildout files, the object id is a random 31-bit negative value
|
||||||
@@ -776,6 +778,10 @@ void ServerBuildoutManagerNamespace::loadArea(AreaInfo &areaInfo)
|
|||||||
|
|
||||||
if (containerId == 0 || objects.find(containerId) != objects.end())
|
if (containerId == 0 || objects.find(containerId) != objects.end())
|
||||||
{
|
{
|
||||||
|
// store original ObjId from buildout table as ObjVar on item for reference in-game if needed
|
||||||
|
std::string objVars = areaBuildoutTable.getStringValue(objvarsColumn, buildoutRow);
|
||||||
|
objVars.insert(0, "buildoutObjectId|0|" + std::to_string(originalObjId) + "|");
|
||||||
|
|
||||||
areaInfo.buildoutRows.push_back(
|
areaInfo.buildoutRows.push_back(
|
||||||
BuildoutRow(
|
BuildoutRow(
|
||||||
objId,
|
objId,
|
||||||
@@ -784,7 +790,7 @@ void ServerBuildoutManagerNamespace::loadArea(AreaInfo &areaInfo)
|
|||||||
transform_p,
|
transform_p,
|
||||||
serverTemplate,
|
serverTemplate,
|
||||||
areaBuildoutTable.getStringValue(scriptsColumn, buildoutRow),
|
areaBuildoutTable.getStringValue(scriptsColumn, buildoutRow),
|
||||||
areaBuildoutTable.getStringValue(objvarsColumn, buildoutRow),
|
objVars,
|
||||||
eventRequired,
|
eventRequired,
|
||||||
requiredLoadLevel));
|
requiredLoadLevel));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user