From 1f48228e07461a7df84ef306bbadd8d4befed196 Mon Sep 17 00:00:00 2001 From: Dipesh Amin Date: Thu, 1 Sep 2011 21:22:00 +0100 Subject: Fixes --- main.py | 3 ++- player.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 139f474..ebcc955 100755 --- a/main.py +++ b/main.py @@ -260,7 +260,8 @@ def process_whisper(nick, msg, mapserv): mapserv.sendall(whisper(nick, data[0:len(data)-2]+".")) data = '' - mapserv.sendall(whisper(nick, data[0:len(data)-2]+".")) + if len(data) > 0: + mapserv.sendall(whisper(nick, data[0:len(data)-2]+".")) elif broken_string[0] == '!setslots': # Change the number of slots a user has - !setslots diff --git a/player.py b/player.py index 0c0894c..861dbf5 100644 --- a/player.py +++ b/player.py @@ -6,6 +6,9 @@ This file is part of tradey, a trading bot in the mana world see www.themanaworld.org """ + +import copy + class Item: pass @@ -39,7 +42,7 @@ class Player: def check_inventory(self, user_tree, sale_tree): # Check the inventory state. - test_node = self.inventory.copy() + test_node = copy.deepcopy(self.inventory) for elem in sale_tree.root: item_found = False for item in test_node: -- cgit v1.2.3-70-g09d2