| Mirage Source http://miragesource.net/forums/ |
|
| RTE 9 http://miragesource.net/forums/viewtopic.php?f=201&t=1660 |
Page 1 of 1 |
| Author: | Anthony [ Fri Apr 13, 2007 8:19 pm ] |
| Post subject: | RTE 9 |
I get a Runtime Error 9 Subscript out of Range on these lines right when the client is loading, does anybody know why? I can't seem to pinpoint it. The tricky thing is is that it only happens like, 1 in every 50 times I load the client :p. Code: Function GetPlayerInvItemNum(ByVal Index As Long, ByVal InvSlot As Long) As Long
GetPlayerInvItemNum = Player(Index).Inv(InvSlot).Num End Function It highlights GetPlayerInvItemNum = Player ect. ect. |
|
| Author: | Matt [ Fri Apr 13, 2007 8:21 pm ] |
| Post subject: | |
Do you have it set differently on the client than the server? Could always be the problem. Maybe the player's max inv is set higher on the client than the server. |
|
| Author: | Anthony [ Fri Apr 13, 2007 8:26 pm ] |
| Post subject: | |
Nope, all constants are the same on server and client. I don't know if you noticed me say it only happens once every 50 or so times the client loads |
|
| Author: | Obsidian [ Fri Apr 13, 2007 8:28 pm ] |
| Post subject: | |
something may be incorrectly saved or loaded, and when it's sent to the client, it's out of range... check and make sure that everything that is stored in the players inventory is stored the way it should be (itemnum, val, etc). |
|
| Author: | Matt [ Fri Apr 13, 2007 8:40 pm ] |
| Post subject: | |
Nope, that wasn't there when I read it, or I would have suggested what Obsi did. =P If you need further help with this, I'm on MSN. |
|
| Author: | Tony [ Sat Apr 14, 2007 3:00 am ] |
| Post subject: | |
RTE 9's are such badasses. |
|
| Author: | William [ Sat Apr 14, 2007 11:04 am ] |
| Post subject: | |
Replace: Code: Function GetPlayerInvItemNum(ByVal Index As Long, ByVal InvSlot As Long) As Long GetPlayerInvItemNum = Player(Index).Inv(InvSlot).Num End Function With: Code: Function GetPlayerInvItemNum(ByVal Index As Long, ByVal InvSlot As Long) As Long
If Index < 1 or Index > MAX_PLAYERS or InvSlot < 1 or InvSlot > MAX_INV Then Exit Function GetPlayerInvItemNum = Player(Index).Inv(InvSlot).Num End Function That should fix it, although you should probably also try and find the line of code that causes it. Cause this will not report a error, but the line of code that calls it wont work. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|