SRL Archive - SRL Archives

NextPlayer tweak..


Harry

2008-08-14 22:23:33

procedure NextPlayer(Active: Boolean);
begin
if RandomPlayer then
RandomNextPlayer(Active)
else
begin
WriteLn('NextPlayer(Active: '+booltostr(Active)+');');
Players[CurrentPlayer].Active := Active;
Logout;
PlayerCurTime := (GetSystemTime div 1000);
Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked +
((PlayerCurTime - PlayerStartTime) / 60);
CurrentPlayer := (CurrentPlayer + 1) mod Length(Players);
while Players[CurrentPlayer].Active = False do
begin
CurrentPlayer := (CurrentPlayer + 1) mod Length(Players);
if (AllPlayersInactive) then Wait(60000); // Everybody False. Endless Loop.
end;
SRL_Logs := SRL_Logs + 1;
LoginPlayer;
end;
end;

All I added was the BoolToStr, so no credits please. :rolleyes:

And it is needed because it is annoying when you get a NextPlayer in the debug window because you do not know if your player just went false or not ;)

I hope it gets committed :D

Naike

2008-08-15 07:24:34

I got a problem like this in my script ^^

I just get NextPlayer out of nowere after 4 hours :/ really annoying..
Tried to find out were it came from but i cant find it :(

I say, Add this :)

EvilChicken!

2008-08-17 08:57:08

Sorry for spamming, but I honestly think that this small thingy should be added. It doesn't cause anything to mess up and it is quite handy.


Edit: Thank you, Wizzup?

Wizzup?

2008-08-17 09:01:08

Added.