|
|
|
@ -653,6 +653,10 @@ class Game: |
|
|
|
|
else: |
|
|
|
|
reply = 'not found' |
|
|
|
|
|
|
|
|
|
if command == 'drain': |
|
|
|
|
self.g.draining = True |
|
|
|
|
reply = 'ok' |
|
|
|
|
|
|
|
|
|
if command == 'gapple': |
|
|
|
|
self.g.job.state = self.g.job.find_gapple |
|
|
|
|
if data: |
|
|
|
@ -753,6 +757,10 @@ class Game: |
|
|
|
|
if command == 'use': |
|
|
|
|
self.use_item(0) |
|
|
|
|
|
|
|
|
|
if command == 'test': |
|
|
|
|
reply = 'ok' |
|
|
|
|
self.select_next_item() |
|
|
|
|
|
|
|
|
|
################# Authorized commands ########################## |
|
|
|
|
if authed: |
|
|
|
|
|
|
|
|
@ -897,6 +905,15 @@ class Game: |
|
|
|
|
else: |
|
|
|
|
return False |
|
|
|
|
|
|
|
|
|
def select_next_item(self): |
|
|
|
|
# select the next item slot that has an item |
|
|
|
|
for slot, item in self.g.inv.items(): |
|
|
|
|
if item.present: |
|
|
|
|
self.g.game.choose_slot(slot) |
|
|
|
|
self.g.holding = item.item_id |
|
|
|
|
return True |
|
|
|
|
else: # for |
|
|
|
|
return False |
|
|
|
|
|
|
|
|
|
def drop_stack(self): |
|
|
|
|
packet = PlayerDiggingPacket() |
|
|
|
@ -1112,5 +1129,12 @@ class Game: |
|
|
|
|
else: |
|
|
|
|
self.g.dumping = None |
|
|
|
|
|
|
|
|
|
if self.g.draining and not self.g.item_lock: |
|
|
|
|
if self.select_next_item(): |
|
|
|
|
self.drop_stack() |
|
|
|
|
self.g.item_lock = True |
|
|
|
|
else: |
|
|
|
|
self.g.draining = False |
|
|
|
|
|
|
|
|
|
if not self.g.path: |
|
|
|
|
self.g.correction_count = 0 |
|
|
|
|