Skip to content

Commit

Permalink
actors.c remove unnecessary variable
Browse files Browse the repository at this point in the history
replace GAME_TICKS_PER_SECOND with FPS_FRAMELIMIT.
  • Loading branch information
Hrvt2 committed Dec 6, 2024
1 parent 228610e commit bb924e4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/cdogs/actors.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@
#define GRIMACE_MELEE_TICKS 19
#define DAMAGE_TEXT_DISTANCE_RESET_THRESHOLD (ACTOR_W / 2)
#define FOOTPRINT_MAX 8
#define GAME_TICKS_PER_SECOND 60 // Assuming 60 ticks per second for accumulatedDamage reset

CArray gPlayerIds;

Expand Down Expand Up @@ -144,11 +143,11 @@ void UpdateActorState(TActor *actor, int ticks)
actor->petrified = MAX(0, actor->petrified - ticks);
actor->confused = MAX(0, actor->confused - ticks);

// Reset accumulated damage if 1 second of ticks passed
// Reset accumulated damage if FPS_FRAMELIMIT passed since taking damage
actor->damageCooldownTicks += ticks;
if (actor->accumulatedDamage)
{
if (actor->damageCooldownTicks >= GAME_TICKS_PER_SECOND)
if (actor->damageCooldownTicks >= FPS_FRAMELIMIT)
{
actor->accumulatedDamage = 0;
actor->damageCooldownTicks = 0;
Expand Down

0 comments on commit bb924e4

Please sign in to comment.