summaryrefslogtreecommitdiff
path: root/ZAPD/ZPath.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ZAPD/ZPath.cpp')
-rw-r--r--ZAPD/ZPath.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/ZAPD/ZPath.cpp b/ZAPD/ZPath.cpp
index 849b4ed..8ea6d29 100644
--- a/ZAPD/ZPath.cpp
+++ b/ZAPD/ZPath.cpp
@@ -6,7 +6,8 @@
#include "WarningHandler.h"
#include "ZFile.h"
-REGISTER_ZFILENODE(Path, ZPath);
+REGISTER_ZFILENODE(Path, ZPath); // Old name that is being kept for backwards compatability
+REGISTER_ZFILENODE(PathList, ZPath); // New name that may be used in future XMLs
ZPath::ZPath(ZFile* nParent) : ZResource(nParent)
{
@@ -145,7 +146,7 @@ void PathwayEntry::DeclareReferences(const std::string& prefix)
std::string pointsName;
bool addressFound = Globals::Instance->GetSegmentedPtrName(listSegmentAddress, parent, "Vec3s",
- pointsName, parent->workerID);
+ pointsName, false, parent->workerID);
if (addressFound)
return;
@@ -172,21 +173,26 @@ void PathwayEntry::DeclareReferences(const std::string& prefix)
points.size(), declaration);
}
else
- decl->text = declaration;
+ decl->declBody = declaration;
}
std::string PathwayEntry::GetBodySourceCode() const
{
std::string declaration;
std::string listName;
- Globals::Instance->GetSegmentedPtrName(listSegmentAddress, parent, "Vec3s", listName,
- parent->workerID);
+ Globals::Instance->GetSegmentedPtrName(listSegmentAddress, parent, "Vec3s", listName, parent->workerID);
if (Globals::Instance->game == ZGame::MM_RETAIL)
declaration +=
StringHelper::Sprintf("%i, %i, %i, %s", numPoints, unk1, unk2, listName.c_str());
else
- declaration += StringHelper::Sprintf("%i, %s", numPoints, listName.c_str());
+ {
+ if (numPoints > 0)
+ declaration +=
+ StringHelper::Sprintf("ARRAY_COUNT(%s), %s", listName.c_str(), listName.c_str());
+ else
+ declaration += StringHelper::Sprintf("%i, %s", numPoints, listName.c_str());
+ }
return declaration;
}