Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getTimerDetails returns strange numbers as remaining time, breaking backwards compatibility (?) #3350

Closed
1 task done
FileEX opened this issue Mar 24, 2024 · 1 comment
Closed
1 task done
Labels
bug Something isn't working

Comments

@FileEX
Copy link
Contributor

FileEX commented Mar 24, 2024

Describe the bug

The getTimerDetails function returns strange numbers as the remaining time. The problem is on the client and server side. On previous versions of MTA (I don't know exactly what version it was) it worked correctly.

In its current state, backward compatibility has been broken and any scripts using this function do not work properly.

image

Edit

I thought the function generally returned strange values. However, it only returns these weird numbers in a function that is a timer callback. Outside of this function, it returns the correct time.

theTimer = setTimer(function() end, 1000, 10) -- A timer that does nothing.

function timerDetails()
	local remaining, executesRemaining, timeInterval = getTimerDetails(theTimer) -- Get the timers details
	if (remaining and executesRemaining and timeInterval) then
		outputChatBox("Time remaining this second: "..remaining.." Executes remaining: "..executesRemaining.." Time interval: "..timeInterval)
	else
		outputChatBox("Timer no longer exists")
	end
end
addCommandHandler("timerdetails", timerDetails)

Steps to reproduce

function timerDetails()
	local remaining, executesRemaining, timeInterval = getTimerDetails(theTimer) -- Get the timers details
	print(remaining, executesRemaining, timeInterval);
end
theTimer = setTimer(timerDetails, 1000, 10) -- A timer that does nothing.

Version

Multi Theft Auto v1.6-release-22396

Additional context

No response

Relevant log output

No response

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.
@FileEX FileEX added the bug Something isn't working label Mar 24, 2024
@FileEX FileEX changed the title getTimerDetails returns strange remaining time, breaking backwards compatibility getTimerDetails returns strange numbers as remaining time, breaking backwards compatibility Mar 24, 2024
@FileEX FileEX changed the title getTimerDetails returns strange numbers as remaining time, breaking backwards compatibility getTimerDetails returns strange numbers as remaining time, breaking backwards compatibility (?) Mar 24, 2024
@FileEX
Copy link
Contributor Author

FileEX commented Apr 1, 2024

I'll report it again, more clearly

@FileEX FileEX closed this as completed Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant