Page 1 of 1

[Rseding91] [15.25] LuaPlayer.unlock_achievement unexpected behav.

Posted: Fri Jun 30, 2017 6:25 pm
by Gangsir
Problem: LuaPlayer.unlock_achievement() doesn't produce the same behaviour as documented on it's page of the API, http://lua-api.factorio.com/latest/LuaP ... chievement.

What I expected: Calling the method repeatedly on the same player with the same achievement would do nothing after the first call, like the API says.

What happened instead: The sound and popup for the achievement repeatedly popped up when the method was called repeatedly. This goes against what the API says should happen,
This has any effect only when this is the local player and the achievement isn't unlocked so far.
Steps to reproduce:

1. Use the mod attached to repeatedly call the method without disabling achievements.
2. Open a new factorio world, and wait a bit.
3. You'll see the achievement unlock, but it will keep unlocking every few seconds, as the mod calls it every few seconds.
4. Observe error.

I'm not sure if the method or the docs are wrong.

Re: [Rseding91] [15.25] LuaPlayer.unlock_achievement unexpected behav.

Posted: Sun Jul 02, 2017 1:27 pm
by Rseding91
Thanks for the report. This is now fixed for the next version of 0.15.