From b1bcbca9e212253f1acea6676b08884db39ab068 Mon Sep 17 00:00:00 2001 From: Nicolas Weeger Date: Sat, 28 May 2022 16:15:09 +0200 Subject: [PATCH] Don't check all inventory, use killer.CurrentWeapon Requires server 64cace0e7a1900b21aae7cb16f7c26e8054318f2 or later --- python/events/gkill/sword_of_souls.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/python/events/gkill/sword_of_souls.py b/python/events/gkill/sword_of_souls.py index c94894c2b..b6d103f3c 100644 --- a/python/events/gkill/sword_of_souls.py +++ b/python/events/gkill/sword_of_souls.py @@ -5,15 +5,7 @@ killer = Crossfire.WhoIsActivator() # and the killer is a player (who would be wielding this weapon. if killer.Owner is None and killer.Type == Crossfire.Type.PLAYER: # Find the equipped weapon on the player. - inv = killer.Inventory - weap = None - while inv: - # The artifact name "of Souls" does this. - # Also only do things if the weapon is cursed as a sanity check. - if inv.Applied == 1 and inv.Cursed == 1 and inv.Title == 'of Souls': - weap = inv - break - inv = inv.Below + weap = killer.CurrentWeapon # Don't bother with xp if weapon is missing or already at the maximum level. if weap != None and weap.ItemPower < 115: # Get the victim -- we need to know how much exp they are worth.