Players cannot resupply or reload anti-tank soldiers

Issue #280 resolved
Colin Basnett created an issue

Not sure how this happened, but I suspect it was something to do with the recent changes that @Matt_UK made to the rocket loading and unloading.

Comments (4)

  1. Matt Hands

    Should be fixed in commit d1d883b. It looks like a big change but most of it is indentation & layout changes; there's actually little functional change.

    In DHHud I had checked the player's Weapon to (1) see if it is a type capable of receiving resupply or assisted reload and (2) see if it is a DHRocketWeapon, to differentiate from MG resupply. That was to avoid unnecessary replicated bools bWeaponCanBeResupplied & bWeaponCanBeReloaded in DHPawn, just to flag weapon properties that are static.

    PROBLEM: the Weapon reference is not replicated to other net clients, so their HUD's got nothing & never permitted a resupply or assisted reload, even when the replicated bools bWeaponNeedsResupply & bWeaponNeedsReload had been set by the server & replicated to clients.

    SOLUTION: pawn's current 3rd person WeaponAttachment is replicated to all clients, so I have checked if that is a DHRocketWeaponAttachment to determine whether or not the weapon is an AT weapon, instead of using the Weapon ref. And don't need the HUD's clientside checks that the weapon bWeaponCanBeResupplied or bWeaponCanBeReloaded, because the server has already checked that & used the weapon's properties to determine whether or not the weapon can currently be resupplied or reloaded, then replicated the authoritative results to all clients.

    Think that should work now & I've tested as much as I can my end. Still ends up with minimal replication, still keeping out the replication I'd removed earlier. Have left the LogSupply() exec in and updated it, as it will be useful in debugging any further problems. But will remove once fix is confirmed.

  2. Log in to comment