diff options
| author | Aldrik Ramaekers <aldrik@amftech.nl> | 2023-04-30 14:06:36 +0200 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@amftech.nl> | 2023-04-30 14:06:36 +0200 |
| commit | 9e70ced6b48d627f236af8ea8366c6ed73748ab1 (patch) | |
| tree | 0c8306a6744923364e7b4c17f9b334ff2529e700 /include | |
| parent | d402270d68d7d4a1c887b34cd93e5f11aa61b638 (diff) | |
fix zombie pathfinding bug
Diffstat (limited to 'include')
| -rw-r--r-- | include/game.h | 1 | ||||
| -rw-r--r-- | include/pathfinding.h | 1 | ||||
| -rw-r--r-- | include/protocol.h | 2 | ||||
| -rw-r--r-- | include/zombies.h | 5 |
4 files changed, 5 insertions, 4 deletions
diff --git a/include/game.h b/include/game.h index d2461b2..f2fd0cb 100644 --- a/include/game.h +++ b/include/game.h @@ -9,6 +9,7 @@ #define SERVER_TICK_RATE (1.0f/60.0f) #define SERVER_MAX_PLAYERS (10) +#define SERVER_PATHFINDING_INTERVAL (0.25f) typedef enum t_game_state { GAMESTATE_IDLE, diff --git a/include/pathfinding.h b/include/pathfinding.h index 9dcaab3..e648f2c 100644 --- a/include/pathfinding.h +++ b/include/pathfinding.h @@ -15,6 +15,7 @@ typedef struct t_pathfinding_request array *to_fill; uint64_t timestamp; mutex mutex; + bool active; } pathfinding_request; array global_pathfinding_queue; diff --git a/include/protocol.h b/include/protocol.h index 8fd33b9..9750d62 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -53,7 +53,7 @@ typedef struct t_protocol_user_list typedef struct t_protocol_zombie_list { network_message_type type; - zombie zombies[MAX_ZOMBIES]; + zombie zombies[SERVER_MAX_ZOMBIES]; } protocol_zombie_list; #include "drops.h" diff --git a/include/zombies.h b/include/zombies.h index 72836ea..0c18bef 100644 --- a/include/zombies.h +++ b/include/zombies.h @@ -28,11 +28,10 @@ typedef struct t_spawner { } spawner; #define MAX_SPAWNERS (5) -// data data that is stored on disk spawner spawner_tiles[MAX_SPAWNERS] = {0}; -#define MAX_ZOMBIES (50) -zombie zombies[MAX_ZOMBIES] = {0}; +#define SERVER_MAX_ZOMBIES (50) +zombie zombies[SERVER_MAX_ZOMBIES] = {0}; void create_spawner(vec2 position); void draw_spawners(platform_window* window); |
