Binoculars spam many "accessed none" error messages to the log

Issue #90 resolved
Matt Hands created an issue

EndState function in state LoweringWeapon contains a bug, where most of the code is duplicated by an unwanted call to a Super.

This also results in accessed none errors whenever binoculars are lowered, by trying to call on FireModes that don't exist for binoculars. This tends to spam errors to the log.

Comments (2)

  1. Matt Hands reporter

    This overridden state function goes in DH_BinocularsItem:

    simulated state LoweringWeapon
    {
        // Matt: modified to fix problem that writes many 'accessed none' errors to the log
        // Need to avoid Super from ROWeapon, which only duplicates Super from BinocularsItem but adds unwanted calls on FireMode classes that binoculars don't have
        simulated function EndState()
        {
            if (bUsingSights && Role == ROLE_Authority)
            {
                ServerZoomOut(false);
            }
    
            if (ClientState == WS_PutDown)
            {
                if (Instigator.PendingWeapon == none)
                {
                    PlayIdle();
                    ClientState = WS_ReadyToFire;
                }
                else
                {
                    ClientState = WS_Hidden;
                    Instigator.ChangedWeapon();
    
                    if (Instigator.Weapon == self)
                    {
                        PlayIdle();
                        ClientState = WS_ReadyToFire;
                    }
                }
            }
        }
    }
    
  2. Log in to comment