mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-16 19:43:06 +01:00
Fixed incorrectly assuming peep was underground if on water
This commit is contained in:
@@ -154,9 +154,10 @@ void map_update_tile_pointers()
|
||||
|
||||
/**
|
||||
* Return the absolute height of an element, given its (x,y) coordinates
|
||||
*
|
||||
* ax: x
|
||||
* cx: y
|
||||
* dx: return
|
||||
* dx: return remember to & with 0xFFFF if you don't want water affecting results
|
||||
* rct2: 0x00662783
|
||||
*/
|
||||
int map_element_height(int x, int y)
|
||||
|
||||
@@ -281,7 +281,7 @@ void viewport_update_position(rct_window *window)
|
||||
if (window->viewport_target_sprite != -1){
|
||||
rct_sprite* sprite = &g_sprite_list[window->viewport_target_sprite];
|
||||
|
||||
int height = map_element_height(0xFFFF & sprite->unknown.x, 0xFFFF & sprite->unknown.y) - 16;
|
||||
int height = map_element_height(0xFFFF & sprite->unknown.x, 0xFFFF & sprite->unknown.y) & 0xFFFF - 16;
|
||||
int underground = sprite->unknown.z < height;
|
||||
|
||||
RCT2_CALLPROC_X(0x6E7A15, sprite->unknown.x, sprite->unknown.y, sprite->unknown.z, underground, (int)window, (int)viewport, 0);
|
||||
|
||||
Reference in New Issue
Block a user