Bug #326: Fake Trades
ID | #326 |
---|---|
Submitter | callum |
Product | EOSERV |
Severity | Normal |
Status | CLOSED, FIXED |
Submitted | 4th Mar 2015 |
Updated | 11th Mar 2015 |
Rev# | Date | Description |
---|---|---|
r454 | 11 Mar 2015 05:05:53 UTC | Re-order trade amount clamping to reject offering 0 of items you don't have (bug #326) |
EOServ doesn't check if the item amount is <= 0 like when dropping items, It lets players trade x0 of an item.
Comments
The bug #313 is referring to when you're dropping items. This bug is referring to when you're trading items. Sausage may have added a check for both already, but I think these would be considered two different bugs :o
@Apollo There were x0 items traded on my r450, but adding an amount <=0) return fixed it..
Looks like the checks are missing in the official build. This should be more proper:
In Trade.cpp function Trade Add line 218 in r450:
UTIL_FOREACH(character->trade_inventory, item)
{
if (item.id == itemid && item.amount > 0)
{
offered = true;
break;
}
}
And in function Trade Agree insert this at line 128:
UTIL_FOREACH(character->trade_inventory, item)
{
if (character->HasItem(item.id, true) < item.amount && item.amount > 0) return;
}
UTIL_FOREACH(character->trade_partner->trade_inventory, item)
{
if (character->trade_partner->HasItem(item.id, true) < item.amount && item.amount > 0) return;
}
This should prevent any trade that is improper from passing as legit, but please don't consider this an official fix and do replace this with an official one should this particular bug get resolved.
Can't reproduce. Amount of 0 is always rejected in Character::AddTradeItem.
Updated Status to CLOSED, INVALID
Now, I know that the bug said 0, but did you try a null value or a less-than-0 value?
Turns out it happens because it clamps the value to the amount you have after checking for zero, which results in zero items if you don't have any of them.
Updated Status to OPEN, CONFIRMED
Fixed in r454.
Updated Status to CLOSED, FIXED
Add Comment
Please don't post unless you have something relevant to the bug to say.
Do not comment to say "thanks" or "fix this please".
Please log in to add comments. EOSERV Bug Tracker > Bug #326: Fake Trades