mirror of https://github.com/OpenRCT2/OpenRCT2.git
small fixes to world/map.c
This commit is contained in:
parent
0a86b8c946
commit
017899c0d9
|
@ -4352,7 +4352,7 @@ bool map_large_scenery_get_origin(
|
|||
*
|
||||
* rct2: 0x006B9B05
|
||||
*/
|
||||
void sign_set_colour(int x, int y, int z, int direction, int sequence, uint8 mainColour, uint8 textColour)
|
||||
bool sign_set_colour(int x, int y, int z, int direction, int sequence, uint8 mainColour, uint8 textColour)
|
||||
{
|
||||
rct_map_element *mapElement;
|
||||
rct_scenery_entry *sceneryEntry;
|
||||
|
@ -4360,7 +4360,9 @@ void sign_set_colour(int x, int y, int z, int direction, int sequence, uint8 mai
|
|||
sint16 offsetX, offsetY;
|
||||
int x0, y0, z0;
|
||||
|
||||
if (!map_large_scenery_get_origin(x, y, z, direction, sequence, &x0, &y0, &z0, &mapElement));
|
||||
if (!map_large_scenery_get_origin(x, y, z, direction, sequence, &x0, &y0, &z0, &mapElement)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
sceneryEntry = g_largeSceneryEntries[(mapElement->properties.scenerymultiple.type) & 0x3FF];
|
||||
sceneryTiles = sceneryEntry->large_scenery.tiles;
|
||||
|
@ -4385,6 +4387,8 @@ void sign_set_colour(int x, int y, int z, int direction, int sequence, uint8 mai
|
|||
map_invalidate_tile(x, y, mapElement->base_height * 8 , mapElement->clearance_height * 8);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4764,7 +4768,7 @@ void game_command_set_banner_name(int* eax, int* ebx, int* ecx, int* edx, int* e
|
|||
return;
|
||||
}
|
||||
|
||||
utf8 *buffer = RCT2_ADDRESS(RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, uint8);
|
||||
utf8 *buffer = RCT2_ADDRESS(RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, utf8);
|
||||
utf8 *dst = buffer;
|
||||
dst = utf8_write_codepoint(dst, FORMAT_COLOUR_CODE_START + banner->text_colour);
|
||||
strncpy(dst, newName, 32);
|
||||
|
@ -4881,7 +4885,7 @@ void game_command_set_banner_style(int* eax, int* ebx, int* ecx, int* edx, int*
|
|||
|
||||
int colourCodepoint = FORMAT_COLOUR_CODE_START + banner->text_colour;
|
||||
|
||||
uint8 buffer[256];
|
||||
utf8 buffer[256];
|
||||
format_string(buffer, banner->string_idx, 0);
|
||||
int firstCodepoint = utf8_get_next(buffer, NULL);
|
||||
if (firstCodepoint >= FORMAT_COLOUR_CODE_START && firstCodepoint <= FORMAT_COLOUR_CODE_END) {
|
||||
|
@ -4953,7 +4957,7 @@ void game_command_set_sign_style(int* eax, int* ebx, int* ecx, int* edx, int* es
|
|||
return;
|
||||
}
|
||||
|
||||
sign_set_colour(
|
||||
if (!sign_set_colour(
|
||||
banner->x * 32,
|
||||
banner->y * 32,
|
||||
mapElement->base_height,
|
||||
|
@ -4961,7 +4965,10 @@ void game_command_set_sign_style(int* eax, int* ebx, int* ecx, int* edx, int* es
|
|||
mapElement->properties.scenerymultiple.type >> 10,
|
||||
mainColour,
|
||||
textColour
|
||||
);
|
||||
)) {
|
||||
*ebx = MONEY32_UNDEFINED;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
rct_window* w = window_bring_to_front_by_number(WC_BANNER, *ecx);
|
||||
|
@ -5010,4 +5017,3 @@ rct_map_element *map_get_track_element_at_of_type(int x, int y, int z, int track
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -369,7 +369,7 @@ bool map_element_is_underground(rct_map_element *mapElement);
|
|||
void map_remove_out_of_range_elements();
|
||||
void map_extend_boundary_surface();
|
||||
|
||||
void sign_set_colour(int x, int y, int z, int direction, int sequence, uint8 mainColour, uint8 textColour);
|
||||
bool sign_set_colour(int x, int y, int z, int direction, int sequence, uint8 mainColour, uint8 textColour);
|
||||
void map_remove_walls_at(int x, int y, int z0, int z1);
|
||||
void map_remove_walls_at_z(int x, int y, int z);
|
||||
|
||||
|
|
Loading…
Reference in New Issue