• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ Trade BUG

mackerel

Well-Known Member
Joined
Apr 26, 2017
Messages
398
Solutions
18
Reaction score
72
I've been testing trade functionality recently and there is one bug I wanted to address. If someone could test it to confirm it would be great. Latest 1.3 TFS

To reproduce the bug:
Have your 1st character with only magic sword in your left hand or any other type of equipment. Make sure you DO NOT have a bag/backpack equipped

Your 2nd character will want to have the slot filled that will be accepted in trade. For example, if you are trading magic sword from 1st character, make sure you have any other type of sword equipped on this one. What you have to do on this character is to have a bag/backpack equipped. You will want to trade this container for magic sword

Expected result:
The trade will be cancelled because 2nd character does not have any slots left to accept the magic sword

Actual result, either of the following:
  • (Common Case) 1st player is receiving bag while 2nd player is not receiving magic sword , magic sword stays with the owner
  • (Rare Case) 1st player is receiving bag while the magic sword disappears
 
Seems like the common case for me is that it completely disappears if all other inventory slots are filled after trading main backpack.
 
Seems like the common case for me is that it completely disappears if all other inventory slots are filled after trading main backpack.
YEAS :D Not enough testing. I already have a potential fix. Ensuring both players have bag equipped. Not the best though so I'll try to fix it in upcoming days and come up with something different
 
when did it broke? I don't experience it on master branch from 3 months ago november 19 and newest otx v3 (path 8.6)

(char 1 only magic sword, char 2 sword slot occupied bp full, trading bp for magic sword, always not enough room)
 
Last edited:
when did it broke? I don't experience it on master branch from 3 months ago and newest otx v3 (path 8.6)

(char 1 only magic sword, char 2 sword slot occupied bp full, trading bp for magic sword, always not enough room)

Thanks for this! I did the same and it appears that the bug is not there when your container is FILLED. Have at least one empty space in your bag when trading.
 
1 slot free
otx: not enough room error
tfs (build from nov 19): same

char 1 magic sword, char 2 bp with 1 slot free and both hands occupied, trying trade both ways

does it have something to do with classic slots enabled?
 
1 slot free
otx: not enough room error
tfs (build from nov 19): same

char 1 magic sword, char 2 bp with 1 slot free and both hands occupied, trying trade both ways

does it have something to do with classic slots enabled?

Hmm it could be something related to how slots work in higher client versions. I remember in the past you could place anything you want in your left/right hand as well as the arrow slot. Now, in 10.98 it seems like it is no longer possible, hence the bug? but I could be wrong.

I just compiled latest TFS without any modifications to make sure it wasn't me 🤣, running 10.98 client:

Here's the video

This is working fine

This is where bug happens (click on the link to open video)
 

Do I understand the code logic right?
1. Add trade partner's magic sword copy (to original bag)
2. Add trade partner's bag copy
3. Remove original sword
4. Remove original bag (with sword copy lol)

This not only miscalculates free cap and space, but also makes items disappear.

A good fix would be checking cap and slots, then cloning the items into memory, then removing original items, then adding the copies. It also needs slight improvements (I don't know why it doesn't try to equip traded items first).
 
Last edited:

Do I understand the code logic right?
1. Add trade partner's magic sword copy (to original bag)
2. Add trade partner's bag copy
3. Remove original sword
4. Remove original bag (with sword copy lol)

This not only miscalculates free cap and space, but also makes items disappear.

A good fix would be checking cap and slots, then cloning the items into memory, then removing original items, then adding the copies. It also needs slight improvements (I don't know why it doesn't try to equip traded items first).

I believe we have these functions here so you can easily extract return values without writing additional code, simply by executing add/remove items and then you can do simple comparison. I will try and re-write this :) it might take few days as im not familiar with C++
 
Someone msged me on discord to tell you to check store inbox also. See if the swords don't land there.
 
Someone msged me on discord to tell you to check store inbox also. See if the swords don't land there.

Good idea, but unfortunately I cannot open this inbox lol. I am not familiar with latest Tibia features but I am guessing that this button higlighted in red should open the store inbox, what happens is the value 'Sorry, not possible' is being returned and that's it. Which means there is no way of checking. I thought it is because I do not have premium account, so I checked with and without premium, the same result.

1587706282031.png

Let's assume it would've landed in this store box you can't open, then it would also be possible to trade the sword even if your bag is full of items (see first GIF video)
 
Last edited:
Back
Top