Penetration check always fail if hit gun mantlet of casemate style tank destroyers

Issue #134 resolved
Matt Hands created an issue

Applies to marder, stug, stuh, JP4, jagdpanther, jagdtiger.

NB - Actually only some of these have a 'turret' collision box for the mantlet, so the others will never even register a gun mantlet hit (probably needs mantlet collision box adding for the others, but that's a different issue.

The code is fundamentally non-functional. If a shell calls a penetration check in the cannon class & bIsAssaultGun is true, DHShouldPenetrate() sets a bAssaultWeaponHit flag in the vehicle class & just returns false. It doesn't call any penetration check on the vehicle class, so nothing happens. This means the shell just registers a failed penetration.

The code & properties to check penetration against the mantlet armour values are in the vehicle class. It never gets used.

Solution is simply to move the code & properties to the cannon class & in the cannon's DHShouldPenetrate() simply check against mantlet armour if bIsAssaultGun and return true or false based on that. bAssaultWeaponHit is pointless & gets deprecated.

Comments (2)

  1. Log in to comment