This player
is active. Thus the first 2 attempts work.
On the third code example the player is again active. But it does not work.
This
will not work:
Players[CurrentPlayer].Active := True;
Players[CurrentPlayer].Active := LoginPlayer;
Edit: This appears to be a "quirk" of Simba.
Just tried this with another routine where the call looks like this:
Players[CurrentPlayer].Active := SomeBooleanFunction
It appears that inside that routine changing the value of Result updates Active in
real time. Result is passed back and placed in Active
before the actual return call. Every time you change Result it again gets passed back at that moment.
So in the case of LoginPlayer, the first thing it does is Result := LoggedIn, which sets Result to False, which sets the player active to False, which causes it to not login. Ugh.
Don't think is this 100% proper Pascal handling of the return result but at least now I know what is going on.