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

Shop Bug?
http://miragesource.net/forums/viewtopic.php?f=193&t=4841
Page 1 of 1

Author:  deathknight [ Sat Dec 13, 2008 1:38 am ]
Post subject:  Shop Bug?

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(

Author:  genusis [ Sun Dec 14, 2008 4:04 pm ]
Post subject:  Re: Shop Bug?

ok gakien or DFA i need you for a second here..

x = Shop(ShopNum).TradeItem(i).GetItem

is not getting the item number. for some strange reason. so Ive been sitting here trying to figure out why but i can't think of it so i will need your help. so if your not busy i could use ya ^^.

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