Refactor handling of hit radii in projectiles.

penev discovered that the RulesetLoaded functions of projectiles were
never being called, meaning that their blocking calculations were not
properly accounting for actors with large hitboxes.

The best fix for this is to change FindActorsOnLine to always account
for the largest actor's hit radius, rather than forcing callers to pass
the largest radius. Per the comment in Util.cs, as a result, move this
computation to ActorMap. I decided to simplify by not making a separate
calculation for actors that block projectiles only; this may cause a
small performance degradation as the search space is a bit larger.

Similarly to this, I've removed the ability to specify a search radius
manually. Because this is only a search radius, setting a value smaller
than the largest eligible actor makes no sense; that would lead to
completely inconsistent blocking. Setting a larger value, on the other
hand, would make no difference.

CreateEffectWarhead was the only place in core code any of these search
radii were set, and that's because 0 was a mysterious magic value that
made the warhead incapable of hitting actors. I replaced it with a
boolean flag that more clearly indicates the actual behaviour.

Fixes #14151.
This commit is contained in:
Alexis Hunt
2018-01-17 20:50:26 -05:00
committed by reaperrr
parent c4b0ad45e3
commit 08ad7d7f4e
31 changed files with 106 additions and 180 deletions

View File

@@ -21,7 +21,7 @@
Warhead@3Eff: CreateEffect
Explosions: small_frag
ImpactSounds: xplos.aud
VictimScanRadius: 0
ImpactActors: false
70mm:
Inherits: ^BallisticWeapon

View File

@@ -11,7 +11,7 @@
Warhead@2Eff: CreateEffect
Explosions: poof
ImpactSounds: xplos.aud
VictimScanRadius: 0
ImpactActors: false
Warhead@3Smu: LeaveSmudge
SmudgeType: Crater
InvalidTargets: Vehicle, Structure, Wall, Husk, Trees, Creep
@@ -92,7 +92,7 @@ BuildingExplode:
Warhead@1Eff: CreateEffect
Explosions: building, building_napalm, med_frag, poof, small_building
Delay: 1
VictimScanRadius: 0
ImpactActors: false
Warhead@2Smu: LeaveSmudge
SmudgeType: Crater
Delay: 1

View File

@@ -31,7 +31,7 @@
Warhead@3Eff: CreateEffect
Explosions: small_frag
ImpactSounds: xplos.aud
VictimScanRadius: 0
ImpactActors: false
ValidTargets: Ground, Water, Air
Dragon:
@@ -130,7 +130,7 @@ MammothMissiles:
Warhead@4EffAir: CreateEffect
Explosions: small_building
ImpactSounds: xplos.aud
VictimScanRadius: 0
ImpactActors: false
ValidTargets: Air
227mm:
@@ -208,7 +208,7 @@ BoatMissile:
Warhead@4EffAir: CreateEffect
Explosions: small_building
ImpactSounds: xplos.aud
VictimScanRadius: 0
ImpactActors: false
ValidTargets: Air
TowerMissile:

View File

@@ -23,7 +23,7 @@
Warhead@3Eff: CreateEffect
Explosions: small_napalm
ImpactSounds: flamer2.aud
VictimScanRadius: 0
ImpactActors: false
Flamethrower:
Inherits: ^FlameWeapon
@@ -144,4 +144,4 @@ Demolish:
Warhead@2Eff: CreateEffect
Explosions: building
ImpactSounds: xplobig6.aud
VictimScanRadius: 0
ImpactActors: false

View File

@@ -29,7 +29,7 @@ Sniper:
DamageTypes: Prone50Percent, TriggerProne, BulletDeath
Warhead@2Eff: CreateEffect
Explosions: piffs
VictimScanRadius: 0
ImpactActors: false
ValidTargets: Ground, Water, Air
HighV:

View File

@@ -16,7 +16,7 @@ Atomic:
Warhead@2Eff_impact: CreateEffect
Explosions: nuke_explosion
ImpactSounds: nukexplo.aud
VictimScanRadius: 0
ImpactActors: false
Warhead@3Dam_areanukea: SpreadDamage
Spread: 2c512
Damage: 11000
@@ -41,7 +41,7 @@ Atomic:
Warhead@6Eff_areanukea: CreateEffect
ImpactSounds: xplobig4.aud
Delay: 3
VictimScanRadius: 0
ImpactActors: false
Warhead@7Dam_areanukeb: SpreadDamage
Spread: 3c768
Damage: 5000