How odd.
This works:
Simba Code:LoginPlayer;
As does this:
Simba Code:SomeBooleanVar := LoginPlayer;
But this does not. It returns immediately with a result of True.
Simba Code:Players[CurrentPlayer].Active := LoginPlayer;
How odd.
This works:
Simba Code:LoginPlayer;
As does this:
Simba Code:SomeBooleanVar := LoginPlayer;
But this does not. It returns immediately with a result of True.
Simba Code:Players[CurrentPlayer].Active := LoginPlayer;
Never ever approach a computer saying or even thinking "I will just do this quickly".
read the login.scar
it will not login a player that is not active.
thus you must set the player as active AHEAD of time. then you can reset their activeness based on loginplayer
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:
Simba Code: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:Simba Code: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.
Last edited by Bixby Sayz; 04-11-2011 at 03:57 AM.
Never ever approach a computer saying or even thinking "I will just do this quickly".
There are currently 1 users browsing this thread. (0 members and 1 guests)