From 53e140e8419f9c067de22949bcea45ede750bf75 Mon Sep 17 00:00:00 2001 From: Nicholas Estelami Date: Mon, 1 May 2023 19:24:14 -0400 Subject: 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 --- ZAPD/ZPath.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ZAPD/ZPath.cpp') 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; } -- cgit v1.2.3