From 1b0a73c1cdf17cdb13c639ea28efd4e506667b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Fri, 24 Jun 2016 22:29:22 +0200 Subject: [PATCH] Revert "fix loading of footpath chunks" This reverts commit 46bf0a47d9c51bfe3e903bef62101ca1946db93c. --- src/object.c | 4 ++-- src/object_list.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/object.c b/src/object.c index a80313510b..ac0c1d0745 100644 --- a/src/object.c +++ b/src/object.c @@ -1929,11 +1929,11 @@ static uint8* object_type_path_load(void *objectEntry, uint32 entryIndex, int *c rct_footpath_entry *pathEntry = (rct_footpath_entry*)objectEntry; const uint8 *origExtendedEntryData = (uint8*)((size_t)objectEntry + 0x0E); const size_t extendedDataSize = *chunkSize - 0x0E; - *chunkSize = *chunkSize + 0x0E - 0x0E; + *chunkSize = *chunkSize + sizeof(rct_footpath_entry) - 0x0E; assert(*chunkSize > 0); rct_footpath_entry* outPathEntry = malloc(*chunkSize); assert(outPathEntry != NULL); - uint8 *extendedEntryData = (uint8*)((size_t)outPathEntry + 0x0E); + uint8 *extendedEntryData = (uint8*)((size_t)outPathEntry + sizeof(rct_footpath_entry)); memcpy(extendedEntryData, origExtendedEntryData, extendedDataSize); pathEntry->string_idx = object_get_localised_text(&extendedEntryData, OBJECT_TYPE_PATHS, entryIndex, 0); diff --git a/src/object_list.c b/src/object_list.c index a9abfc667f..383fee3519 100644 --- a/src/object_list.c +++ b/src/object_list.c @@ -30,7 +30,7 @@ #include "world/scenery.h" #include "world/water.h" -#define PLUGIN_VERSION 5 +#define PLUGIN_VERSION 4 #define FILTER_VERSION 1 typedef struct rct_plugin_header {