Don't check all inventory, use killer.CurrentWeapon

Requires server 64cace0e7a1900b21aae7cb16f7c26e8054318f2 or later
master
Nicolas Weeger 2022-05-28 16:15:09 +02:00
parent b4031a6bc7
commit b1bcbca9e2
1 changed files with 1 additions and 9 deletions

View File

@ -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.