Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why are we using/wasting so many loops?
#2
Fine..

In Joingame
(Note, you can just do + 1 too, but I think that's just a bit too buggy, plus, a recount every now and then isn't going to hurt anyone
Code:
For i = 1 To MAX_PLAYERS
        If IsPlaying(i) Then
        PlayersOnline = PlayersOnline + 1
    End If
    Next i
somewhere:
Code:
Public PlayersOnline As Byte

In leavegame
Code:
PlayersOnline = PlayersOnline - 1

And replace most instances of MAX_PLAYERS with PlayersOnline.


Not tested.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)