should fix players not performing damage after being broken for an unknown amount of time, maybe never working correctly

This commit is contained in:
Fate-JH 2024-04-15 18:58:40 -04:00
parent 9645bd79d4
commit c229d50261

View file

@ -102,11 +102,14 @@ class WeaponAndProjectileOperations(
if (tool.Magazine <= 0) { //safety: enforce ammunition depletion
prefire -= weaponGUID
EmptyMagazine(weaponGUID, tool)
projectiles(projectileGUID.guid - Projectile.baseUID) = None
(None, None)
} else if (!player.isAlive) { //proper internal accounting, but no projectile
prefire += weaponGUID
tool.Discharge()
projectiles(projectileGUID.guid - Projectile.baseUID) = None
shotsWhileDead += 1
(None, None)
} else { //shooting
if (
avatar.stamina > 0 &&
@ -121,8 +124,8 @@ class WeaponAndProjectileOperations(
tool.Discharge()
prefire += weaponGUID
addShotsFired(tool.Definition.ObjectId, tool.AmmoSlot.Chamber)
(o, Some(tool))
}
(o, Some(tool))
}
collectedTools.headOption.getOrElse((None, None))
} else {