Fix runner bug of not reaching water surface
Also fix bound checking in runnerscene_man
parent
6e2ccfa875
commit
89d962d2bc
|
@ -63,20 +63,17 @@ static void runner_BFS(const TileGrid_t* tilemap, CWaterRunner_t* p_crunner, int
|
|||
unsigned int next = curr_idx + p_crunner->bfs_tilemap.width;
|
||||
Tile_t* next_tile = tilemap->tiles + next;
|
||||
|
||||
if (next < p_crunner->bfs_tilemap.len)
|
||||
{
|
||||
if (
|
||||
curr_height > curr_low
|
||||
&& curr_tile->water_level < tilemap->max_water_level
|
||||
&& next_tile->water_level < tilemap->max_water_level
|
||||
)
|
||||
{
|
||||
*lowest_tile = curr_idx;
|
||||
}
|
||||
|
||||
|
||||
if (next < p_crunner->bfs_tilemap.len)
|
||||
{
|
||||
to_go[0] = next_tile->solid != SOLID;
|
||||
}
|
||||
|
||||
if (
|
||||
next_tile->solid == SOLID
|
||||
|
@ -97,6 +94,7 @@ static void runner_BFS(const TileGrid_t* tilemap, CWaterRunner_t* p_crunner, int
|
|||
to_go[2] = next_tile->solid != SOLID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (curr_tile->water_level == tilemap->max_water_level)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue