orts/server

Promotion bug in login.lua

Closed this issue · 2 comments

Bug:
Any premium character will receive a promotion upon login even if the character never before got promoted.
How to reproduce:
Create a character without promotion and login. The character will automatically be promoted.
What is expected:

  • If character has storagevalue promoted but is not premium, character should not be promoted, but storagevalue should not change.
  • If character has storagevalue promoted and is premium, character should be promoted, but storagevalue should not change.
  • If character does not have storage value promoted then it should not be promoted no matter if premium or not.

As it is now the logic in the if statements for promotion in login.lua is rather weird actually.

I can't reproduce this issue. However I pushed a minor fix regarding that code.

be2fe44
you removed the fix regarding ?

login.lua Minor fixes from TFS repo 15 days ago

elseif value == 1 then
player:setVocation(promotion)
end