Bugged zoom OlRifle in MonsterHunt

Discussions about GameTypes
Post Reply
Buggie
Godlike
Posts: 2741
Joined: Sat Mar 21, 2020 5:32 am

Bugged zoom OlRifle in MonsterHunt

Post by Buggie »

If you use MonsterHunt.OlRifle on dedicated server then you can cancel zoom by release AltFire button only for very short time.
After that you release AltFire button does not matter. Zoom will still increase to end.
This happen because of call PlayAltFiring(); in code:

Code: Select all

simulated function bool ClientAltFire (float Value)
{
  PlayAltFiring();
  GotoState('Zooming');
  return True;
}
So when some (dumb and useless) animation over, something happen (possible call AnimatinEnd which produce call of idle animation play, and so on) and Tick on client side not called.

Code: Select all

state Zooming
{
  simulated function Tick (float DeltaTime)
  {
    if ( Pawn(Owner).bAltFire == 0 )
    {
      if ( (PlayerPawn(Owner) != None) && PlayerPawn(Owner).Player.IsA('Viewport') )
      {
        PlayerPawn(Owner).StopZoom();
      }
      SetTimer(0.0,False);
      GotoState('Idle');
    }
  }
On server side it called and weapon forced by server to state 'Idle', where you can not stop increase zoom, so it goes to maximum.

Unfortunately this things complete clients sided, so can not be fixed by conformed MonsterHunt.u on server.
As possible fix it can be mutator which replace weapon to subclassed one, where PlayAltFiring() does nothing.

Anyway if from server conformed MonsterHunt.u not fix problem, on client it solve problem:
MonsterHunt_with_sources_503_fix_rifle_zoom.zip
(381.09 KiB) Downloaded 28 times
Feel free use it for ride of this annoying bug.

Based on my rebuild MH: viewtopic.php?p=121603#p121603
Last edited by Buggie on Sun Apr 11, 2021 9:44 am, edited 1 time in total.
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Bugged zoom OlRifle in MonsterHunt

Post by sektor2111 »

Credits for my update will go at Buggie and... Higor...
Buggie destroying Bug and Higor pointing a solution for non-hard-coded replacements but... configurable ones without requirement to update server mods...

Edit: Of course, here are going to be added a few more sanity checks concerning AmmoType, Owner, etc. which are missing in more places.
Post Reply