Skip to content

Commit 90e2afd

Browse files
committed
use real baseId
1 parent 998c8bc commit 90e2afd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

core/bid.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,9 @@ def bid(q, api, playerList, settings):
148148
q.put('%s Updating watched items...\n' % (time.strftime('%Y-%m-%d %H:%M:%S')))
149149
for item in api.tradeStatus([tradeId for tradeId in trades]):
150150
item['resourceId'] = trades[item['tradeId']]
151-
baseId = str(abs(item['resourceId'] + 0x80000000))
151+
baseId = str(api.baseId(item['resourceId']))
152152
if baseId not in bidDetails:
153+
q.put('%s Trade not found - baseId: %s\n' % (time.strftime('%Y-%m-%d %H:%M:%S'), baseId))
153154
continue
154155
maxBid = bidDetails[baseId]['maxBid']
155156
sell = bidDetails[baseId]['sell']
@@ -159,6 +160,7 @@ def bid(q, api, playerList, settings):
159160

160161
tradeId = item['tradeId']
161162
if tradeId not in trades:
163+
q.put('%s Trade not found - tradeId: %s\n' % (time.strftime('%Y-%m-%d %H:%M:%S'), tradeId))
162164
continue
163165

164166
asset = api.cardInfo(trades[tradeId])
@@ -227,8 +229,9 @@ def bid(q, api, playerList, settings):
227229
# buy now goes directly to unassigned now
228230
if binWon:
229231
for item in api.unassigned():
230-
baseId = str(abs(item['resourceId'] + 0x80000000))
232+
baseId = str(api.baseId(item['resourceId']))
231233
if baseId not in bidDetails:
234+
q.put('%s Trade not found for BIN - baseId: %s\n' % (time.strftime('%Y-%m-%d %H:%M:%S'), baseId))
232235
continue
233236
maxBid = bidDetails[baseId]['maxBid']
234237
sell = bidDetails[baseId]['sell']
@@ -271,7 +274,7 @@ def bid(q, api, playerList, settings):
271274
if not settings['relistAll'] or relistFailed:
272275
q.put('%s Manually re-listing %d players.\n' % (time.strftime('%Y-%m-%d %H:%M:%S'), expired))
273276
for i in tradepile:
274-
baseId = str(abs(i['resourceId'] + 0x80000000))
277+
baseId = str(api.baseId(i['resourceId']))
275278
if baseId in bidDetails:
276279
sell = i['startingBid'] if settings['relistAll'] else bidDetails[baseId]['sell']
277280
binPrice = i['buyNowPrice'] if settings['relistAll'] else bidDetails[baseId]['binPrice']

0 commit comments

Comments
 (0)