From 8cf0bd16848be4bf0d67e80973bf43738afbae32 Mon Sep 17 00:00:00 2001 From: ryo_saeba Date: Sat, 14 Aug 2010 07:44:59 +0000 Subject: [PATCH] Adjust test script to new types. git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13591 282e977c-c81d-0410-88c4-b93c2d0d6712 --- test/python.py | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/test/python.py b/test/python.py index e0cdfa44a..c69b10763 100644 --- a/test/python.py +++ b/test/python.py @@ -354,30 +354,29 @@ def do_checkinv(): def do_face(): obj = whoami.Map.ObjectAt(4, 4) if len(topic) == 1: - whoami.Say('Face is %d'%obj.Face) + whoami.Say('Face is %s'%obj.Face) return - face = Crossfire.FindFace(topic[1]) - if face == 0: - whoami.Say('Invalid face') - return - whoami.Say('changing to %s'%topic[1]) - obj.Face = topic[1] - whoami.Say('Face changed') + face = topic[1] + + try: + obj.Face = face + whoami.Say('Face changed to %s'%face) + except: + whoami.Say('Invalid face %s'%face) def do_anim(): obj = whoami.Map.ObjectAt(4, 4).Above if len(topic) == 1: - whoami.Say('Animation is %d'%obj.Anim) + whoami.Say('Animation is %s'%obj.Anim) return - anim = Crossfire.FindAnimation(topic[1]) - if anim == 0: - whoami.Say('Invalid animation') - return - - obj.Anim = (topic[1]) - whoami.Say('Anim changed') + anim = topic[1] + try: + obj.Anim = anim + whoami.Say('Animation changed to %s'%anim) + except: + whoami.Say('Invalid animation %s'%anim) def do_hook(): item = whoami.Map.CreateObject('food', 0, 0)