Welcome to the AFK Mods bug tracker. In order to report an issue, you need to have a VALIDATED account to post one. Once you have followed the link the registration email sent you, please select a project from the drop down menu below. Select “Open New Issue” and fill out the form with as many details as possible.

Please also consider sending your bug report to Bethesda if you are reporting on an issue with Skyrim Special Edition, Fallout 4, or Starfield. Doing so will help everyone on all platforms.

Issue Data
Status: Closed
Issue Type: Bug Report
Project: Unofficial Fallout 4 Patch
Component: Unofficial Fallout 4 Patch
Category: Papyrus
Assigned To: Nobody
Platform: All
Severity: Very Low
Votes: 0
Watching: N/A
Opened By UndefinedPreCondition on Aug 6, 2023 6:11 pm
Closed By Arthmoor on Feb 18, 2024 2:22 pm
Resolution: Fixed
Comment: Fixed for UFO4P 2.1.6

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