Guard from null scenery entry

This commit is contained in:
Michał Janiszewski authored and Michał Janiszewski committed 2017-04-29 20:56:32 +02:00
1 parent 2609242780
commit a5df306a84
1 file changed
+4
+4
View File
@@ -2760,6 +2760,10 @@ void game_command_place_scenery(sint32* eax, sint32* ebx, sint32* ecx, sint32* e
}
rct_scenery_entry* scenery_entry = get_small_scenery_entry(scenery_type);
if (scenery_entry == NULL) {
*ebx = MONEY32_UNDEFINED;
return;
}
if(scenery_entry->small_scenery.flags & SMALL_SCENERY_FLAG_FULL_TILE || !(scenery_entry->small_scenery.flags & SMALL_SCENERY_FLAG9)){
if(scenery_entry->small_scenery.flags & (SMALL_SCENERY_FLAG9 | SMALL_SCENERY_FLAG24 | SMALL_SCENERY_FLAG25)){