From 322d45a5dd16042559b4e252c96395f5b8a1a97b Mon Sep 17 00:00:00 2001 From: Duncan Frost Date: Tue, 9 Jun 2015 18:16:27 +0100 Subject: [PATCH] Prevent invalid sprite coordinates from breaking sprite list. Fixes @Gymnasiast 's issues in sandbox --- src/world/sprite.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/world/sprite.c b/src/world/sprite.c index fb253b5745..ede41f10d8 100644 --- a/src/world/sprite.c +++ b/src/world/sprite.c @@ -827,6 +827,9 @@ void sprite_misc_update_all() * dx: z */ void sprite_move(sint16 x, sint16 y, sint16 z, rct_sprite* sprite){ + if (x < 0 || y < 0 || x > 0x1FFF || y > 0x1FFF) + x = 0x8000; + int new_position = x; if (x == (sint16)0x8000)new_position = 0x10000; else{