Issue Data
|
Issue #33086: DLC03:TrapBear: checkPerks has non-exhaustive checks for actors
Fix for Issue #26360 introduces a bug where bear traps won't react correctly to a OnTriggerEnter event when triggering ref is an actor without the LightFoot perk.
if (triggerRef as actor).hasPerk(LightFoot)is missing a matching else block leading to a state where at best a falsy (if any) value is returned to caller. This leaves the script and trap in a Open state after a hit (effects in script DLC03TrapHit are applied). Modified function (in file DLC03:TrapBear.psc) below (and in attached patch file) fixes this bug and when applied fixes bear traps in-game so that they snap shut when actor walks into them. Bool function checkPerks(objectReference triggerRef) if checkForLightFootPerk ; ;debug.Trace(self + " is checking if " + triggerRef + " has LightFoot Perk") ;UFO4P 2.0.8 Bug #26360 Actor ref = triggerRef as Actor if ref && ref.hasPerk(LightFoot) ; ;debug.Trace(self + " has found that " + triggerRef + " has LightFoot Perk") if utility.randomFloat(0.0,100.00) <= LightFootTriggerPercent.getValue() ; ;debug.Trace(self + " is returning false due to failed lightfoot roll") return False else ; ;debug.Trace(self + " is returning true due to successful lightfoot roll") return True endif Else ; debug.Trace(self + " has found that " + triggerRef + " doesn't have the LightFoot Perk") Return True EndIf else return True endif endFunction |
Related Issues: 26360