Skip to content

fix: Initialize player cooldown timers on login - #935

Merged
jprzimba merged 1 commit into
mainfrom
globals
Sep 15, 2026
Merged

jprzimba merged 1 commit into
mainfrom
globals

Conversation

@jprzimba

@jprzimba jprzimba commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

The problem:

Hardcoded 1 means "epoch time" (1970). If cooldown checks compare os.time() >= NextUseStaminaTime[playerId], the value 1 is always less than current time (~1.7 billion), so the cooldown is always expired — players can immediately reuse stamina/XP/concoction after login, bypassing intended cooldowns.

The fix:

Setting to os.time() starts the cooldown from the actual login moment. If the code later adds cooldown duration (e.g., NextUseStaminaTime[id] = os.time() + cooldownSeconds), it works correctly.

This updates the player login script to initialize stamina, XP stamina, and concoction cooldown timers using the current Unix time instead of a hardcoded 1. This ensures cooldown tracking starts from the actual login moment and prevents immediate reuse or incorrect timing behavior.
@jprzimba
jprzimba merged commit f773940 into main Sep 15, 2026
16 checks passed
@jprzimba
jprzimba deleted the globals branch September 15, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant