diff --git a/src/game.cpp b/src/game.cpp index 974e8be..9be8982 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -78,6 +78,12 @@ void game_update_players(game_t *game, double dt) { player_t *player = &game->player[i]; if (player->status == 0) return; + if (player->vx > 500.0) + player->vx = 500.0; + if (player->vy > 500.0) + player->vy = 500.0; + if (player->vz > 500.0) + player->vz = 500.0; player->x += player->vx * dt; player->y += player->vy * dt; player->z += player->vz * dt; @@ -90,7 +96,7 @@ void _explode_bomb(game_t *game, bomb_t *bomb, void(*explosion_callback)( for (i = 0; i < GAME_PLAYER_COUNT; i++) { player_t *player = &game->player[i]; if (player->status == 0) - return; + continue; double distance2 = pow(player->x - bomb->x, 2) + pow(player->y - bomb->y, 2) + pow(player->z - bomb->z, 2); if (distance2 < 10000.0) { @@ -111,7 +117,7 @@ void game_update_bombs(game_t *game, double dt, void(*explosion_callback)( for (i = 0; i < GAME_BOMB_COUNT; i++) { bomb_t *bomb = &game->bomb[i]; if (bomb->status == 0) - return; + continue; bomb->x += bomb->vx * dt; bomb->y += bomb->vy * dt; bomb->z += bomb->vz * dt; diff --git a/src/game.h b/src/game.h index c971afd..e2460b0 100644 --- a/src/game.h +++ b/src/game.h @@ -7,7 +7,7 @@ typedef struct team_t team_t; typedef struct player_t player_t; typedef struct game_t game_t; -#define GAME_TEAM_COUNT 8 +#define GAME_TEAM_COUNT 2 #define GAME_PLAYER_COUNT 64 #define GAME_BOMB_COUNT (GAME_PLAYER_COUNT * 4)