Bugged zoom OlRifle in MonsterHunt

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

Bugged zoom OlRifle in MonsterHunt

Post by Buggie » Sun Apr 11, 2021 5:51 am

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
Feel free use it for ride of this annoying bug.

Based on my rebuild MH: viewtopic.php?p=121603#p121603
You do not have the required permissions to view the files attached to this post.
Last edited by Buggie on Sun Apr 11, 2021 9:44 am, edited 1 time in total.

User avatar
sektor2111
Godlike
Posts: 6028
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Bugged zoom OlRifle in MonsterHunt

Post by sektor2111 » Sun Apr 11, 2021 7:56 am

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.