Mirage Engine
Old Bug - Printable Version

+- Mirage Engine (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Source Code Development (https://mirage-engine.uk/forums/forumdisplay.php?fid=51)
+----- Forum: Mirage Source 3.x.x, MSx (https://mirage-engine.uk/forums/forumdisplay.php?fid=45)
+----- Thread: Old Bug (/showthread.php?tid=552)



Old Bug - Rian - 29-12-2006

Quote: ' Characters (we use 0 to prevent a crash that still needs to be figured out)
Char(0 To MAX_CHARS) As PlayerRec
Found in the account rec. I wonder if this is anything major.

Has anyone looked into this? Has anyone noticed it?


- William - 29-12-2006

Never seen it, but guess its worth checking out.


- Misunderstood - 29-12-2006

I don't see why it needs to be changed.
Whats the diff starting from 0 as opposed to 1?
Arrays in languages outside of vb start at 0...its nothing crazy.


- William - 29-12-2006

It cant be that hard to find a fix.


- Rian - 29-12-2006

Misunderstood Wrote:I don't see why it needs to be changed.
Whats the diff starting from 0 as opposed to 1?
Arrays in languages outside of vb start at 0...its nothing crazy.

Good. Tongue
Just wanted confirmation that this is nothing serious.


- William - 29-12-2006

So, I checked it out. This was the problem when you changed it to 1:
Code:
Function GetPlayerMap(ByVal Index As Long) As Long
        GetPlayerMap = Player(Index).Char(Player(Index).CharNum).Map
End Function
supscript out of range 9

So it should work by changing that function to:
Code:
Function GetPlayerMap(ByVal Index As Long) As Long
    If Player(Index).CharNum > 0 And Player(Index).CharNum < MAX_CHARS + 1 Then
        GetPlayerMap = Player(Index).Char(Player(Index).CharNum).Map
    End If
End Function
Have not done much testing thought. Seems to work fine.


Re: Old Bug - Robin - 15-07-2008

You should have all your arrays start from 0. Gets you ready to move into the bigger languages Tongue