summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDipesh Amin <yaypunkrock@gmail.com>2011-09-01 21:22:00 +0100
committerDipesh Amin <yaypunkrock@gmail.com>2011-09-01 21:22:35 +0100
commit1f48228e07461a7df84ef306bbadd8d4befed196 (patch)
treec44d104a61f8ed2618e3606ba0c7edf5358929f5
parentb1049b4b6d328740f306a1b67292ab68d5dade73 (diff)
downloadmanamarket-1f48228e07461a7df84ef306bbadd8d4befed196.tar.gz
manamarket-1f48228e07461a7df84ef306bbadd8d4befed196.tar.bz2
manamarket-1f48228e07461a7df84ef306bbadd8d4befed196.tar.xz
manamarket-1f48228e07461a7df84ef306bbadd8d4befed196.zip
Fixes
-rwxr-xr-xmain.py3
-rw-r--r--player.py5
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 <slots> <name>
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: