From 8cfc71ccae4c440c88c52d940d899ce2e2b59f22 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Tue, 9 Jun 2015 01:24:02 +0100 Subject: [PATCH] fix #1269 --- src/world/sprite.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/world/sprite.c b/src/world/sprite.c index 38633833ba..fb253b5745 100644 --- a/src/world/sprite.c +++ b/src/world/sprite.c @@ -651,15 +651,17 @@ void reset_0x69EBE4(){ void sprite_clear_all_unused() { rct_unk_sprite *sprite; - uint16 spriteIndex, nextSpriteIndex; + uint16 spriteIndex, nextSpriteIndex, previousSpriteIndex; spriteIndex = RCT2_GLOBAL(RCT2_ADDRESS_SPRITES_NEXT_INDEX, uint16); while (spriteIndex != SPRITE_INDEX_NULL) { sprite = &g_sprite_list[spriteIndex].unknown; nextSpriteIndex = sprite->next; + previousSpriteIndex = sprite->previous; memset(sprite, 0, sizeof(rct_sprite)); sprite->sprite_identifier = SPRITE_IDENTIFIER_NULL; sprite->next = nextSpriteIndex; + sprite->previous = previousSpriteIndex; sprite->linked_list_type_offset = SPRITE_LINKEDLIST_OFFSET_NULL; sprite->sprite_index = spriteIndex; spriteIndex = nextSpriteIndex;