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

@@ -31,7 +31,7 @@ Debris:
InvalidTargets: Vehicle, Structure
Warhead@3Eff: CreateEffect
Explosions: tiny_explosion
VictimScanRadius: 0
ImpactActors: false
Debris2:
Inherits: Debris

View File

@@ -25,7 +25,7 @@
InvalidTargets: Vehicle, Structure
Warhead@3Eff: CreateEffect
Explosions: small_napalm
VictimScanRadius: 0
ImpactActors: false
110mm_Gun:
Inherits: ^Cannon

View File

@@ -30,7 +30,7 @@
InvalidTargets: Vehicle, Structure
Warhead@3Eff: CreateEffect
Explosions: tiny_explosion
VictimScanRadius: 0
ImpactActors: false
ValidTargets: Ground, Air
^Missile:

View File

@@ -85,7 +85,7 @@ OrniBomb:
Warhead@3Eff: CreateEffect
Explosions: large_explosion
ImpactSounds: EXPLSML4.WAV
VictimScanRadius: 0
ImpactActors: false
Crush:
Warhead@1Dam: SpreadDamage
@@ -100,7 +100,7 @@ Demolish:
Warhead@2Eff: CreateEffect
Explosions: building
ImpactSounds: EXPLLG2.WAV
VictimScanRadius: 0
ImpactActors: false
Atomic:
Warhead@1Dam: SpreadDamage
@@ -121,7 +121,7 @@ Atomic:
Warhead@2Eff: CreateEffect
Explosions: nuke
ImpactSounds: EXPLLG2.WAV
VictimScanRadius: 0
ImpactActors: false
CrateNuke:
Inherits: Atomic
@@ -151,36 +151,36 @@ CrateExplosion:
Warhead@2Eff: CreateEffect
Explosions: large_explosion
ImpactSounds: EXPLSML4.WAV
VictimScanRadius: 0
ImpactActors: false
UnitExplodeSmall:
Warhead@1Eff: CreateEffect
Explosions: self_destruct
ImpactSounds: EXPLSML1.WAV
VictimScanRadius: 0
ImpactActors: false
UnitExplodeMed:
Warhead@1Eff: CreateEffect
Explosions: building
ImpactSounds: EXPLSML2.WAV
VictimScanRadius: 0
ImpactActors: false
UnitExplodeLarge:
Warhead@1Eff: CreateEffect
Explosions: large_explosion
ImpactSounds: EXPLLG2.WAV
VictimScanRadius: 0
ImpactActors: false
BuildingExplode:
Warhead@1Eff: CreateEffect
Explosions: building, self_destruct, large_explosion
VictimScanRadius: 0
ImpactActors: false
WallExplode:
Warhead@1Eff: CreateEffect
Explosions: wall_explosion
ImpactSounds: EXPLHG1.WAV
VictimScanRadius: 0
ImpactActors: false
grenade:
ReloadDelay: 50
@@ -211,7 +211,7 @@ grenade:
Warhead@3Eff: CreateEffect
Explosions: med_explosion
ImpactSounds: EXPLMD2.WAV
VictimScanRadius: 0
ImpactActors: false
GrenDeath:
Warhead@1Dam: SpreadDamage
@@ -232,7 +232,7 @@ GrenDeath:
Warhead@3Eff: CreateEffect
Explosions: building
ImpactSounds: EXPLSML4.WAV
VictimScanRadius: 0
ImpactActors: false
SardDeath:
Warhead@1Dam: SpreadDamage
@@ -254,7 +254,7 @@ SardDeath:
Warhead@3Eff: CreateEffect
Explosions: small_napalm
ImpactSounds: EXPLSML2.WAV
VictimScanRadius: 0
ImpactActors: false
SpiceExplosion:
Projectile: Bullet
@@ -284,7 +284,7 @@ SpiceExplosion:
Size: 1
Warhead@3Eff: CreateEffect
Explosions: med_explosion
VictimScanRadius: 0
ImpactActors: false
BloomExplosion:
Report: EXPLMD1.WAV

View File

@@ -19,7 +19,7 @@
DamageTypes: Prone50Percent, TriggerProne, BulletDeath
Warhead@2Eff: CreateEffect
Explosions: piffs
VictimScanRadius: 0
ImpactActors: false
LMG:
Inherits: ^MG