Use signed int for water runners
parent
15bb9c84ae
commit
2968172921
|
@ -148,9 +148,9 @@ typedef struct _BFSTile {
|
||||||
|
|
||||||
typedef struct _BFSTileMap {
|
typedef struct _BFSTileMap {
|
||||||
BFSTile_t* tilemap;
|
BFSTile_t* tilemap;
|
||||||
uint32_t width;
|
int32_t width;
|
||||||
uint32_t height;
|
int32_t height;
|
||||||
uint32_t len;
|
int32_t len;
|
||||||
}BFSTileMap_t;
|
}BFSTileMap_t;
|
||||||
|
|
||||||
typedef enum _WaterRunnerState
|
typedef enum _WaterRunnerState
|
||||||
|
|
|
@ -180,7 +180,7 @@ void update_water_runner_system(Scene_t* scene)
|
||||||
switch (p_crunner->state)
|
switch (p_crunner->state)
|
||||||
{
|
{
|
||||||
case BFS_RESET:
|
case BFS_RESET:
|
||||||
for (size_t i = 0; i < p_crunner->bfs_tilemap.len; ++i)
|
for (int32_t i = 0; i < p_crunner->bfs_tilemap.len; ++i)
|
||||||
{
|
{
|
||||||
//p_crunner->bfs_tilemap.tilemap[i].to = -1;
|
//p_crunner->bfs_tilemap.tilemap[i].to = -1;
|
||||||
p_crunner->bfs_tilemap.tilemap[i].from = -1;
|
p_crunner->bfs_tilemap.tilemap[i].from = -1;
|
||||||
|
@ -254,7 +254,7 @@ void update_water_runner_system(Scene_t* scene)
|
||||||
int start_tile =
|
int start_tile =
|
||||||
(p_crunner->current_tile / p_crunner->bfs_tilemap.width) * p_crunner->bfs_tilemap.width;
|
(p_crunner->current_tile / p_crunner->bfs_tilemap.width) * p_crunner->bfs_tilemap.width;
|
||||||
|
|
||||||
for (size_t i = 0; i < p_crunner->bfs_tilemap.width; ++i)
|
for (int32_t i = 0; i < p_crunner->bfs_tilemap.width; ++i)
|
||||||
{
|
{
|
||||||
p_crunner->bfs_tilemap.tilemap[start_tile + i].reachable = false;
|
p_crunner->bfs_tilemap.tilemap[start_tile + i].reachable = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ static void level_scene_render_func(Scene_t* scene)
|
||||||
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
bot <= tilemap.n_tiles
|
(unsigned int)bot <= tilemap.n_tiles
|
||||||
&& tilemap.tiles[bot].water_level < MAX_WATER_LEVEL
|
&& tilemap.tiles[bot].water_level < MAX_WATER_LEVEL
|
||||||
&& tilemap.tiles[i].water_level == 0
|
&& tilemap.tiles[i].water_level == 0
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue