Skip to content

Commit

Permalink
Fix some newly introduced bugs in OnDamageDealt
Browse files Browse the repository at this point in the history
  • Loading branch information
ToxicFrog committed Jul 18, 2022
1 parent c77580a commit 44b70fe
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
5 changes: 5 additions & 0 deletions laevis/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.7.1

- Fix: crash in OnDamageDealt when attacks lacked an inflictor
- Fix: OnDamageDealt didn't properly trigger for some attacks

# 0.7.0

- New: Lightning tree
Expand Down
2 changes: 1 addition & 1 deletion laevis/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME=Laevis
VERSION=0.7.0
VERSION=0.7.1
LUMPS=zscript.txt MAPINFO CVARINFO KEYCONF MENUDEF LANGUAGE.* sprites
LUMPS+=*.md COPYING.freedoom
ZSDIR=ca.ancilla.laevis
Expand Down
14 changes: 8 additions & 6 deletions laevis/ca.ancilla.laevis/PerPlayerStats.zs
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,14 @@ class ::PerPlayerStats : Inventory {
// deciding what kinds of upgrades to spawn.
let info = GetInfoForCurrentWeapon();
if (!info) return;
// Don't count damage from special effects.
if (shot.special1 != ::Upgrade::PRI_MISSING) return;
if (shot && shot.bMISSILE) {
info.projectile_shots++;
} else {
info.hitscan_shots++;
// Don't count damage from special effects. Do count damage where there's no
// inflictor, for now; might want to revisit that later.
if (!shot || shot.special1 != ::Upgrade::PRI_MISSING) {
if (shot && shot.bMISSILE) {
info.projectile_shots++;
} else {
info.hitscan_shots++;
}
}
info.upgrades.OnDamageDealt(owner, shot, target, damage);
}
Expand Down

0 comments on commit 44b70fe

Please sign in to comment.