Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Eclipse Stable: fixing the "selling negative items" glitch?


Firestar
 Share

Recommended Posts

Not sure if this is known or not, but if you sell a negative amount of an item, like… let's say -58, you'll apparently get that many of said item. Yes, you can clone items like this...

Is there a way to fix this? If not, my game will have to be without a selling system forever...
Link to comment
Share on other sites

Hello ^^, i remember i had the same problem a few weeks ago.
To fix it, open the source [client side] and find:

```
AMT = InputBox("How many " & Item(GetPlayerInvItemNum(MyIndex, (lstSellItem.ListIndex + 1))).name & " would you like to sell?", "Sell " & Trim$(Item(GetPlayerInvItemNum(MyIndex, (lstSellItem.ListIndex + 1))).name), 0)
                        If IsNumeric(AMT) Then
                            packet = "sellitem" & SEP_CHAR & snumber & SEP_CHAR & ItemNum & SEP_CHAR & ItemSlot & SEP_CHAR & AMT & END_CHAR
                            Call SendData(packet)
                            lblSold.Caption = "You sold " & AMT & " " & Trim$(Item(ItemNum).name) & "s ."
                        End If

```
its in the frmSellItem.

Now Replace the line

```
If IsNumeric(AMT) Then

```
with

```
If IsNumeric(AMT) and AMT > 0 Then

```
Thats the way i fixed it ^^

yours sincerely,
krumelz
Link to comment
Share on other sites

Give me a second, I'll fix it in a vanilla stable and post the compiled EXE.

Krumelz. I'd recommend adding this fix too, as your way still leaves it open for anyone who knows how to edit packets to duplicate items on your game. :P

**Server:**
In _modHandleData_'s _Sub BlahBlah_.

Find:
```
Public Sub Packet_SellItem(ByVal index As Long, ByVal ShopNum As Long, ByVal ItemNum As Long, ByVal ItemSlot As Long, ByVal ItemAmt As Long)

```
Add After
```
    If ItemAmt <= 0 Then
        Call PlayerMsg(index, "You can not sell an amount lower than 1!", RED)
        Call HackingAttempt(index, "Selling a negative amount of an item.")
        Exit Sub
    End If

```
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...