This commit is contained in:
Shadow15510 2021-07-05 15:34:22 +02:00
parent 8936befc3b
commit 51b689e6c6
3 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,9 @@
#include <gint/std/stdlib.h>
#include <math.h>
#include <gint/display.h>
#include <gint/keyboard.h>
#include "epidemic_engine.h"
@ -53,10 +56,9 @@ void epidemic_simulation(struct game *current_game)
{
// Healthy
case 0:
// Become infected
if (can_become_infected(current_game->grid, current_game->mutations_selected, i, j) && bernoulli(current_game->contagion))
{
{
current_grid[i + j * current_game->grid.width] = 1;
if (world[j][i])
{

View File

@ -71,6 +71,7 @@ int main(void)
// Allocate memory
current_game.grid.data = calloc(current_game.grid.width * current_game.grid.height, sizeof(uint8_t));
for (int i = 0; i < current_game.grid.width * current_game.grid.height; i ++) current_game.grid.data[i] = 0;
current_game.grid.data[290 + 50 * current_game.grid.width] = 1;
current_game.humans[0] = (current_game.grid.width * current_game.grid.height) - 1 - BLANK_CASES;

View File

@ -37,7 +37,7 @@ void read_save(struct game *current_game)
BFile_Create(filename, BFile_File, &size);
}
// Loading game data
// else loading game data
else
{
fd = BFile_Open(filename, BFile_ReadOnly);