TGITS-Solutions / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
1 stars 1 forks source link

Friendly fire from automatic turrets with explosive or other special ammo #2

Open TrainTurningPoint opened 5 years ago

TrainTurningPoint commented 5 years ago

Describe the bug
projectile.cpp contains method aoe_size(), presumably producing the radius of affected area and used by vehicle turrets to determine if they will hit player. Presumably, because the code for checking if the player is hit is very confusing, adding distance in tiles to angles in degrees and all that. Nonetheless, the AoE radiuses used by turrets seem to be invalid. I expect turrets to reliably hit player with HE ammo, frequently damage him with fragmentation grenades, and also completely ignore the player when shooting flashbangs, gas canisters, lightning, plasma cannon and mininukes.

To Reproduce
Get a vehicle with automatic special effect turrets. Stand close to a hostile creature in the turret range (whily not in a line of fire). Get shot.

Expected behavior
Not getting shot.

Additional context
Unverified, just an assumption based on reading the code.

Coolthulhu commented 5 years ago

The aoe_size doesn't work because it was written with ancient AoE sizes in mind. In explosion.cpp there is safe_range, which calculates or at least approximates safe distance from epicenter of shrapnel-less explosion.