From 0c4149180d242bc39b4160ccdb9203fdb7ef7ec8 Mon Sep 17 00:00:00 2001 From: anmaster Date: Thu, 12 Feb 2009 09:28:12 +0000 Subject: [PATCH] Fix a bug causing tracebacks in /python/start/dragon_attune.py. If there was no player on the changer it ended up as None which resulted in a traceback. git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@11460 282e977c-c81d-0410-88c4-b93c2d0d6712 --- python/start/dragon_attune.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/python/start/dragon_attune.py b/python/start/dragon_attune.py index ac939492f..a9fa35bde 100644 --- a/python/start/dragon_attune.py +++ b/python/start/dragon_attune.py @@ -39,11 +39,12 @@ changer = Crossfire.WhoAmI() aname = Crossfire.ScriptParameters() atype = getattr(Crossfire.AttackTypeNumber, aname.upper()) player = changer -while player.Archetype.Name != 'pl_dragon': +while player and player.Archetype.Name != 'pl_dragon': player = player.Above -force = player.CheckArchInventory('dragon_ability_force') -force.Exp = atype -player.Anim = animations[atype] -player.Face = faces[atype] -player.Title = '%s hatchling' % aname -changer.Say("Your metabolism is now focused on me.") +if player: + force = player.CheckArchInventory('dragon_ability_force') + force.Exp = atype + player.Anim = animations[atype] + player.Face = faces[atype] + player.Title = '%s hatchling' % aname + changer.Say("Your metabolism is now focused on me.")