Substantial re-work of shell's ProcessTouch function (bug fixes, improvements, consistency)

Issue #108 resolved
Matt Hands created an issue

Substantial re-work on critical function, affecting gameplay, so logged as an issue. Shell's ProcessTouch is called by Touch event when shell hits a VehicleWeapon (turret or MG, including player's collision box), player pawn or destroyable static mesh.

Bugs & inconsistencies:

  1. If shell hits exposed VehicleWeapon 'Driver' (e.g. commander), it still registers a shell hit on the vehicle itself, with penetration calcs, possible deflection or vehicle destruction.
  2. Shell hit on an exposed MG with a collision box also registers as hit on vehicle itself & may destroy vehicle.
  3. Some functions passed Velocity after Physics set to none, which zeroes velocity (re-order or use local SavedVelocity, like HitWall does).
  4. IsPointShot function in ROVehicleWeapon, used to check whether hit Driver's head & body HitPoints, is not simulated so always returns false on clients.
  5. Shell explodes on impact with 'Driver', player pawn or a destroyable mesh that won't even stop bullets, e.g. glass.
  6. Parts of Drawdebuglines functionality don't work, as called on server not client.
  7. HE shell doesn't do HitPointTrace when hits player pawn, as all others do.
  8. HEAT shell handles a non-penetrating turret hit as if it were a deflection, when it is an explosion.
  9. Various duplicated & unnecessary checks and other minor inconsistencies.

All above bugs & inconsistencies fixed, plus these enhancements:

  • If a penetrating hit on a VehicleWeapon, now calls TakeDamage on VW itself instead of VehicleBase. TankCannon's TakeDamage modified to call TD on VehicleBase, so has same effect. But MG's TD doesn't do this, avoiding damage to vehicle & allowing custom MG functionality to wreck the MG.

  • If shell hits VehicleWeapon 'Driver', player pawn or a destroyable mesh that won't stop bullets, it now damages that actor but carries on. If hit a player, shell's velocity is slightly reduced.

All seems to work ok, but obviously needs a good test. Note some similar work required in HitWall event, called when shell hits a vehicle hull, but not as much.

Comments (3)

  1. Log in to comment