mirror of https://github.com/OpenRCT2/OpenRCT2.git
fix loading of footpath chunks
This commit is contained in:
parent
da08b963c9
commit
46bf0a47d9
|
@ -1929,11 +1929,11 @@ static uint8* object_type_path_load(void *objectEntry, uint32 entryIndex, int *c
|
||||||
rct_footpath_entry *pathEntry = (rct_footpath_entry*)objectEntry;
|
rct_footpath_entry *pathEntry = (rct_footpath_entry*)objectEntry;
|
||||||
const uint8 *origExtendedEntryData = (uint8*)((size_t)objectEntry + 0x0E);
|
const uint8 *origExtendedEntryData = (uint8*)((size_t)objectEntry + 0x0E);
|
||||||
const size_t extendedDataSize = *chunkSize - 0x0E;
|
const size_t extendedDataSize = *chunkSize - 0x0E;
|
||||||
*chunkSize = *chunkSize + sizeof(rct_footpath_entry) - 0x0E;
|
*chunkSize = *chunkSize + 0x0E - 0x0E;
|
||||||
assert(*chunkSize > 0);
|
assert(*chunkSize > 0);
|
||||||
rct_footpath_entry* outPathEntry = malloc(*chunkSize);
|
rct_footpath_entry* outPathEntry = malloc(*chunkSize);
|
||||||
assert(outPathEntry != NULL);
|
assert(outPathEntry != NULL);
|
||||||
uint8 *extendedEntryData = (uint8*)((size_t)outPathEntry + sizeof(rct_footpath_entry));
|
uint8 *extendedEntryData = (uint8*)((size_t)outPathEntry + 0x0E);
|
||||||
memcpy(extendedEntryData, origExtendedEntryData, extendedDataSize);
|
memcpy(extendedEntryData, origExtendedEntryData, extendedDataSize);
|
||||||
|
|
||||||
pathEntry->string_idx = object_get_localised_text(&extendedEntryData, OBJECT_TYPE_PATHS, entryIndex, 0);
|
pathEntry->string_idx = object_get_localised_text(&extendedEntryData, OBJECT_TYPE_PATHS, entryIndex, 0);
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include "world/scenery.h"
|
#include "world/scenery.h"
|
||||||
#include "world/water.h"
|
#include "world/water.h"
|
||||||
|
|
||||||
#define PLUGIN_VERSION 4
|
#define PLUGIN_VERSION 5
|
||||||
#define FILTER_VERSION 1
|
#define FILTER_VERSION 1
|
||||||
|
|
||||||
typedef struct rct_plugin_header {
|
typedef struct rct_plugin_header {
|
||||||
|
|
Loading…
Reference in New Issue