1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Fix launchpad builds (#12575)

```
/<<PKGBUILDDIR>>/src/openrct2-ui/interface/ViewportInteraction.cpp: In function ‘InteractionInfo viewport_interaction_get_item_left(const ScreenCoordsXY&)’:
/<<PKGBUILDDIR>>/src/openrct2-ui/interface/ViewportInteraction.cpp:85:29: error: potential null pointer dereference [-Werror=null-dereference]
   85 |             switch (sprite->sprite_identifier)
      |                     ~~~~~~~~^~~~~~~~~~~~~~~~~
```
This commit is contained in:
Michał Janiszewski
2020-08-09 08:27:26 +02:00
committed by GitHub
parent 7cd6e72edd
commit 6f8ae294ae

View File

@@ -65,7 +65,9 @@ InteractionInfo viewport_interaction_get_item_left(const ScreenCoordsXY& screenC
info = get_map_coordinates_from_pos(
screenCoords, VIEWPORT_INTERACTION_MASK_SPRITE & VIEWPORT_INTERACTION_MASK_RIDE & VIEWPORT_INTERACTION_MASK_PARK);
auto tileElement = info.SpriteType != VIEWPORT_INTERACTION_ITEM_SPRITE ? info.Element : nullptr;
auto sprite = info.SpriteType == VIEWPORT_INTERACTION_ITEM_SPRITE ? info.Entity : nullptr;
// Only valid when info.SpriteType == VIEWPORT_INTERACTION_ITEM_SPRITE, but can't assign nullptr without compiler
// complaining
auto sprite = info.Entity;
// Allows only balloons to be popped and ducks to be quacked in title screen
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)