Mirage Source
http://miragesource.net/forums/

Old Bug
http://miragesource.net/forums/viewtopic.php?f=195&t=987
Page 1 of 1

Author:  Rian [ Fri Dec 29, 2006 6:59 pm ]
Post subject:  Old Bug

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?

Author:  lordgivemick [ Fri Dec 29, 2006 7:16 pm ]
Post subject: 

atully that is major since if you change your code just sligty it gives that off as a runtime error and the you have to get red or redo the whole thing in player rec to get it to allow your player to create new charters and log on even.


I say it needs to be fixed and optimized.

Author:  William [ Fri Dec 29, 2006 7:21 pm ]
Post subject: 

Never seen it, but guess its worth checking out.

Author:  lordgivemick [ Fri Dec 29, 2006 8:22 pm ]
Post subject: 

thanx from both me and sonire.

Author:  Misunderstood [ Fri Dec 29, 2006 10:34 pm ]
Post subject: 

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.

Author:  William [ Fri Dec 29, 2006 10:36 pm ]
Post subject: 

It cant be that hard to find a fix.

Author:  Rian [ Fri Dec 29, 2006 10:46 pm ]
Post subject: 

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. :P
Just wanted confirmation that this is nothing serious.

Author:  William [ Fri Dec 29, 2006 11:00 pm ]
Post subject: 

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.

Author:  Robin [ Tue Jul 15, 2008 3:15 pm ]
Post subject:  Re: Old Bug

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

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/