summaryrefslogtreecommitdiff
path: root/ZAPD/ZPath.cpp
diff options
context:
space:
mode:
authorNicholas Estelami <NEstelami@users.noreply.github.com>2023-05-01 19:24:14 -0400
committerGitHub <noreply@github.com>2023-05-01 19:24:14 -0400
commit53e140e8419f9c067de22949bcea45ede750bf75 (patch)
tree1ce185f1d1ddbfe998cbded0dcbca6a28fe22f5b /ZAPD/ZPath.cpp
parentc5aff7567927be4c0fa468614f545b886e09ffe6 (diff)
Use ARRAY_COUNT where possible. (#287)
* ZCollision updated to use ARRAY_COUNT * ZPath updated to use ARRAY_COUNT * Updated ZCollision and ZPath to only use array count when array size > 0
Diffstat (limited to 'ZAPD/ZPath.cpp')
-rw-r--r--ZAPD/ZPath.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/ZAPD/ZPath.cpp b/ZAPD/ZPath.cpp
index 5dae65a..ae50f8a 100644
--- a/ZAPD/ZPath.cpp
+++ b/ZAPD/ZPath.cpp
@@ -186,7 +186,13 @@ std::string PathwayEntry::GetBodySourceCode() const
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;
}