Skip to content

Commit

Permalink
Remove comparison with unsigned vals
Browse files Browse the repository at this point in the history
  • Loading branch information
claudemuller committed Aug 6, 2023
1 parent 19a7c34 commit 5f9806c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Binary file removed lib/libraylib.a
Binary file not shown.
8 changes: 4 additions & 4 deletions src/game.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void game_draw_ui(struct game *g)
DrawText("<right-mouse> - kill cell", 10+padding, s1*10+padding-6, fontSize, DARKBLUE);

size_t active_cell = get_mouse_over_cell(g);
if (active_cell < 0 || active_cell >= g->rows*g->cols) {
if (active_cell >= g->rows*g->cols) {
return;
}

Expand Down Expand Up @@ -177,13 +177,13 @@ bool should_live(const size_t i, const struct game *g)
right = g->dish[i+1];
}

if (i > g->cols && i-g->cols >= 0) {
if (i > g->cols && i-g->cols > 0) {
top = g->dish[i-g->cols];
}
if (i > g->cols && i-g->cols-1 >= 0) {
if (i > g->cols && i-g->cols > 0) {
top_left = g->dish[i-g->cols-1];
}
if (i > g->cols && i-g->cols+1 >= 0) {
if (i > g->cols && i-g->cols+1 > 0) {
top_right = g->dish[i-g->cols+1];
}

Expand Down

0 comments on commit 5f9806c

Please sign in to comment.