mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 09:32:29 +01:00
Implemented sub_68B044 some sort of check to make sure there is space for new element.
If there isn't then it will try reorganise the elements to make room.
This commit is contained in:
@@ -354,6 +354,7 @@
|
||||
#define RCT2_ADDRESS_SCENARIO_SRAND_0 0x00F663B0
|
||||
#define RCT2_ADDRESS_SCENARIO_SRAND_1 0x00F663B4
|
||||
#define RCT2_ADDRESS_MAP_ELEMENTS 0x00F663B8
|
||||
#define RCT2_ADDRESS_MAP_ELEMENTS_END 0x010E53B8
|
||||
|
||||
#define RCT2_ADDRESS_SPRITE_LIST 0x010E63BC
|
||||
#define RCT2_ADDRESS_SPRITES_NEXT_INDEX 0x013573BC
|
||||
|
||||
@@ -2744,7 +2744,23 @@ void map_reorganise_elements()
|
||||
*/
|
||||
int sub_68B044()
|
||||
{
|
||||
return (RCT2_CALLPROC_X(0x0068B044, 0, 0, 0, 0, 0, 0, 0) & 0x100) == 0;
|
||||
if (RCT2_GLOBAL(0x00140E9A4, rct_map_element*) <= RCT2_ADDRESS(RCT2_ADDRESS_MAP_ELEMENTS_END, rct_map_element))
|
||||
return 1;
|
||||
|
||||
for (int i = 1000; i != 0; --i)
|
||||
sub_68B089();
|
||||
|
||||
if (RCT2_GLOBAL(0x00140E9A4, rct_map_element*) <= RCT2_ADDRESS(RCT2_ADDRESS_MAP_ELEMENTS_END, rct_map_element))
|
||||
return 1;
|
||||
|
||||
map_reorganise_elements();
|
||||
|
||||
if (RCT2_GLOBAL(0x00140E9A4, rct_map_element*) <= RCT2_ADDRESS(RCT2_ADDRESS_MAP_ELEMENTS_END, rct_map_element))
|
||||
return 1;
|
||||
else{
|
||||
RCT2_GLOBAL(0x00141E9AC, rct_string_id) = 894;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user