From 88742dce80b463e862609bc7b52aff57e006baaa Mon Sep 17 00:00:00 2001 From: Tomas Dittmann Date: Thu, 12 Oct 2017 21:13:35 +0200 Subject: [PATCH] Ensure null objects are written as -1 to SV6 --- src/openrct2/rct2/S6Exporter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 91b8f6dbcb..aaee9c9b44 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -166,7 +166,8 @@ void S6Exporter::Export() { const rct_object_entry * entry = get_loaded_object_entry(i); void * entryData = get_loaded_object_chunk(i); - if (entryData == (void *)-1) + // RCT2 uses (void *)-1 to mark NULL. Make sure it's written in a vanilla-compatible way. + if (entryData == nullptr || entryData == (void *)-1) { Memory::Set(&_s6.objects[i], 0xFF, sizeof(rct_object_entry)); }