Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shop Bug?
#1
Has anyone else noticed this besides me? With an, almost, blank copy of MS4, when I add a shop and try to go into it, it gives my server RTE9. Here is the shop code it brings me too when I click debug

Code:
Sub SendTrade(ByVal Index As Long, ByVal ShopNum As Long)
Dim Packet As String
Dim i As Long, x As Long, y As Long

    Packet = STrade & SEP_CHAR & ShopNum & SEP_CHAR & Shop(ShopNum).FixesItems
    For i = 1 To MAX_TRADES
        Packet = Packet & SEP_CHAR & Shop(ShopNum).TradeItem(i).GiveItem & SEP_CHAR & Shop(ShopNum).TradeItem(i).GiveValue & SEP_CHAR & Shop(ShopNum).TradeItem(i).GetItem & SEP_CHAR & Shop(ShopNum).TradeItem(i).GetValue
        
        ' Item #
        x = Shop(ShopNum).TradeItem(i).GetItem
        
        If Item(x).Type = ITEM_TYPE_SPELL Then
            ' Spell class requirement
            y = Spell(Item(x).Data1).ClassReq
            
            If y = 0 Then
                Call PlayerMsg(Index, Trim$(Item(x).Name) & " can be used by all classes.", Yellow)
            Else
                Call PlayerMsg(Index, Trim$(Item(x).Name) & " can only be used by a " & GetClassName(y - 1) & ".", Yellow)
            End If
        End If
    Next i
    Packet = Packet & END_CHAR
    
    Call SendDataTo(Index, Packet)
End Sub

and here is the line it highlights

Code:
If Item(x).Type = ITEM_TYPE_SPELL Then

I didn't have any spell items in my shop, nor did I have spells. This RTE went away after I added 2 spell items and 2 spells to my shop, then a new error popped up on

Code:
Function GetClassName(ByVal ClassNum As Long) As String
    GetClassName = Trim$(Class(ClassNum).Name)
End Function

on the

Code:
GetClassName = Trim$(Class(ClassNum).Name)

Any suggestions?

(edit) Forgot to mention the subscript out of range is on the code
Code:
(class(
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)