mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-30 18:25:16 +01:00
Fix #5377: Saved game keeps crashing shortly after loading
Guard against null pointers in banner_paint() (#5379)
This commit is contained in:
committed by
Ted John
parent
34540b6439
commit
8f59b04d32
@@ -76,6 +76,7 @@ Includes all git commit authors. Aliases are GitHub user names.
|
||||
* Jonathan Haas (HaasJona)
|
||||
* Jake Breen (Haekb)
|
||||
* Marco Benzi Tobar (Lisergishnu)
|
||||
* Richard Jenkins (rwjuk)
|
||||
|
||||
## Toolchain
|
||||
* (Balletie) - macOS
|
||||
|
||||
@@ -48,6 +48,10 @@ void banner_paint(uint8 direction, sint32 height, rct_map_element* map_element)
|
||||
|
||||
rct_scenery_entry* banner_scenery = get_banner_entry(gBanners[map_element->properties.banner.index].type);
|
||||
|
||||
if ((banner_scenery == (rct_scenery_entry *)-1) || (banner_scenery == NULL)) {
|
||||
return;
|
||||
}
|
||||
|
||||
direction += map_element->properties.banner.position;
|
||||
direction &= 3;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user