Useless scoped prediction window in ULyraGameplayAbility_RangedWeapon::StartRangedWeaponTargeting()

ULyraGameplayAbility_RangedWeapon::StartRangedWeaponTargeting() creates a FScopedPredictionWindow at line 566 of LyraGameplayAbility_RangedWeapon.cpp

FScopedPredictionWindow ScopedPrediction(MyAbilityComponent, CurrentActivationInfo.GetActivationPredictionKey());

But this FScopedPredictionWindow seems to be useless.

Here is the reason:

StartRangedWeaponTargeting() only execute on locally controlled player.

On regular client (autonomous proxy), this constructor does nothing because IsNetSimulating() returns true.

On Listen server host (authority), the constructor does execute and sets the scoped key, but the host is authoritative — there’s no prediction to manage, no remote client to confirm the key to.

That FScopedPredictionWindow is indeed setting no key at all. It’s using the wrong constructor overload, the server-side one instead of the local prediction one. It doesn’t look like setting a prediction key there would have an effect either, since that key wouldn’t be sent to the server. I’ll look into removing the FScopedPredictionWindow there entirely for a next release. Thank you for bringing this up.

Hello, I’ve removed the FScopedPredictionWindow via CL 51266272 / GH commit da33af3233954f739b4b20ca98fea0393b5d7387. Feel free to remove it on your end too.