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:
@@ -21,7 +21,7 @@
|
||||
Warhead@3Eff: CreateEffect
|
||||
Explosions: small_frag
|
||||
ImpactSounds: xplos.aud
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
|
||||
70mm:
|
||||
Inherits: ^BallisticWeapon
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -29,7 +29,7 @@ Sniper:
|
||||
DamageTypes: Prone50Percent, TriggerProne, BulletDeath
|
||||
Warhead@2Eff: CreateEffect
|
||||
Explosions: piffs
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
ValidTargets: Ground, Water, Air
|
||||
|
||||
HighV:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -31,7 +31,7 @@ Debris:
|
||||
InvalidTargets: Vehicle, Structure
|
||||
Warhead@3Eff: CreateEffect
|
||||
Explosions: tiny_explosion
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
|
||||
Debris2:
|
||||
Inherits: Debris
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
InvalidTargets: Vehicle, Structure
|
||||
Warhead@3Eff: CreateEffect
|
||||
Explosions: small_napalm
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
|
||||
110mm_Gun:
|
||||
Inherits: ^Cannon
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
InvalidTargets: Vehicle, Structure
|
||||
Warhead@3Eff: CreateEffect
|
||||
Explosions: tiny_explosion
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
ValidTargets: Ground, Air
|
||||
|
||||
^Missile:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
DamageTypes: Prone50Percent, TriggerProne, BulletDeath
|
||||
Warhead@2Eff: CreateEffect
|
||||
Explosions: piffs
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
|
||||
LMG:
|
||||
Inherits: ^MG
|
||||
|
||||
@@ -207,7 +207,7 @@ CrateNuke:
|
||||
Warhead@3Eff_impact: CreateEffect
|
||||
Explosions: nuke
|
||||
ImpactSounds: kaboom1.aud
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
Warhead@4Dam_areanuke1: SpreadDamage
|
||||
Spread: 1c0
|
||||
Damage: 6000
|
||||
@@ -224,7 +224,7 @@ CrateNuke:
|
||||
Warhead@6Eff_areanuke1: CreateEffect
|
||||
ImpactSounds: kaboom22.aud
|
||||
Delay: 5
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
Warhead@6Smu_areanuke1: LeaveSmudge
|
||||
SmudgeType: Scorch
|
||||
InvalidTargets: Vehicle, Structure, Wall, Trees
|
||||
@@ -255,7 +255,7 @@ MiniNuke:
|
||||
Warhead@3Eff_impact: CreateEffect
|
||||
Explosions: nuke
|
||||
ImpactSounds: kaboom1.aud
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
Warhead@4Dam_areanuke1: SpreadDamage
|
||||
Spread: 2c0
|
||||
Damage: 6000
|
||||
@@ -273,7 +273,7 @@ MiniNuke:
|
||||
Warhead@6Eff_areanuke1: CreateEffect
|
||||
ImpactSounds: kaboom22.aud
|
||||
Delay: 5
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
Warhead@7Dam_areanuke2: SpreadDamage
|
||||
Spread: 3c0
|
||||
Damage: 6000
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
Inherits: ^AntiGroundMissile
|
||||
ValidTargets: Air
|
||||
Warhead@3Eff: CreateEffect
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
|
||||
Maverick:
|
||||
Inherits: ^AntiGroundMissile
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
Warhead@3Eff: CreateEffect
|
||||
Explosions: napalm
|
||||
ImpactSounds: firebl3.aud
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
|
||||
FireballLauncher:
|
||||
Inherits: ^FireWeapon
|
||||
@@ -195,4 +195,4 @@ MADTankDetonate:
|
||||
Warhead@3Eff: CreateEffect
|
||||
Explosions: med_explosion
|
||||
ImpactSounds: mineblo1.aud
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
|
||||
@@ -50,7 +50,7 @@ Atomic:
|
||||
Warhead@4Eff_impact: CreateEffect
|
||||
Explosions: nuke
|
||||
ImpactSounds: kaboom1.aud
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
ValidTargets: Ground, Water, Air
|
||||
Warhead@5Dam_areanuke1: SpreadDamage
|
||||
Spread: 2c0
|
||||
@@ -73,7 +73,7 @@ Atomic:
|
||||
Warhead@8Eff_areanuke1: CreateEffect
|
||||
ImpactSounds: kaboom22.aud
|
||||
Delay: 5
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
Warhead@9Dam_areanuke2: SpreadDamage
|
||||
Spread: 3c0
|
||||
Damage: 6000
|
||||
|
||||
@@ -85,7 +85,7 @@ MammothTusk:
|
||||
Concrete: 28
|
||||
DamageTypes: Explosion
|
||||
Warhead@2Eff: CreateEffect
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
Explosions: medium_twlt
|
||||
ImpactSounds: expnew07.aud
|
||||
InvalidImpactTypes: Water
|
||||
@@ -147,4 +147,4 @@ RedEye2:
|
||||
Warhead@2Eff: CreateEffect
|
||||
Explosions: large_grey_explosion
|
||||
ImpactSounds: expnew13.aud
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
|
||||
@@ -80,27 +80,27 @@ IonCannon:
|
||||
Explosions: ionbeam
|
||||
ExplosionPalette: effect-ignore-lighting-alpha75
|
||||
ImpactSounds: ion1.aud
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
Warhead@5Effect: CreateEffect
|
||||
Explosions: ionbeam2
|
||||
ExplosionPalette: effect-ignore-lighting-alpha75
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
Warhead@6Effect: CreateEffect
|
||||
Explosions: ionbeam3
|
||||
ExplosionPalette: effect-ignore-lighting-alpha75
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
Warhead@7Effect: CreateEffect
|
||||
Explosions: ionbeam4
|
||||
ExplosionPalette: effect-ignore-lighting-alpha75
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
Warhead@8Effect: CreateEffect
|
||||
Explosions: ionbeam5
|
||||
ExplosionPalette: effect-ignore-lighting-alpha75
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
Warhead@9Effect: CreateEffect
|
||||
Explosions: ionbeam6
|
||||
ExplosionPalette: effect-ignore-lighting-alpha75
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
|
||||
EMPulseCannon:
|
||||
ReloadDelay: 100
|
||||
@@ -115,7 +115,7 @@ EMPulseCannon:
|
||||
Warhead@1Eff: CreateEffect
|
||||
Explosions: pulse_explosion
|
||||
ExplosionPalette: effect-ignore-lighting-alpha75
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
Warhead@emp: GrantExternalCondition
|
||||
Range: 4c0
|
||||
Duration: 250
|
||||
@@ -135,7 +135,7 @@ ClusterMissile:
|
||||
Explosions: large_explosion
|
||||
ExplosionPalette: effect-ignore-lighting-alpha75
|
||||
ImpactSounds: expnew19.aud
|
||||
VictimScanRadius: 0
|
||||
ImpactActors: false
|
||||
Warhead@ResourceDestruction0: DestroyResource
|
||||
Size: 1
|
||||
Warhead@ClusterSmudges0: LeaveSmudge
|
||||
|
||||
Reference in New Issue
Block a user