Welcome to the AFK Mods bug tracker. In order to report an issue, 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.

An account will be required to submit an issue, so if you need one and are unable to register, please contact us via the forums at https://afkmods.iguanadons.net/

Issue Data
Status: Closed
Issue Type: Bug Report
Project: Unofficial Fallout 4 Patch
Component: Fallout 4: Vanilla
Category: Papyrus
Assigned To: Sclerocephalus
Platform: All
Severity: Low
Votes: 0
Watching: N/A
Opened By Sclerocephalus on Oct 6, 2018 3:17 pm
Last Edited By Sclerocephalus on Dec 1, 2018 10:59 am
Closed By Sclerocephalus on Dec 3, 2018 12:49 am
Resolution: Fixed
Comment: Fixed for UFO4P 2.0.6

Issue #25238: WorkshopParentScript - further improvements to unloaded workshop handling by UnassignActor_Private

Only a minor update: so far, we're not unassigning objects that are found although the workshop is not loaded and leave this task to the the next workshop reset. This is done because we may need to send workshop events for the unassigned objects but cannot do this if the workshop is not loaded (sending events is futile if we cannot recalculate the workshop resource values before sending them because the users listening to these events check for changes in the workshop's resource ratings), so this needs to be done by the next workshop reset anyway. If UnassignActor_Private would unassign the objects directly, we would lose track of these objects and could not send events later on because the workshop reset could not spot them (we identify them by their owning actors).

This solution has a flaw: we're stuck with objects for a while that are still registered as being owned but actually are not owned by anyone because their owning actors have already been unassigned from all tasks or even been removed from the workshop. Not a big deal most of the time, because this should only apply if a workshop is not loaded. However, there always remain situations where the checks register a workshop as not loaded although it is. The recent trouble with the oversee'rs job handling terminal is a good example: while using the terminal, the scripts considered the workshop as not being loaded although it was.

It's better, therefore, to unassign the objects directly. but this required to tag the objects in some way, so we can spot them until all remaining tasks (i.e. sending the events) have been completed. As it turned out, there is an unused bool property on WorkshopObjectScript, bResetDone. This was supposed to be used by ResetWorkshop() to flag damaged objects after they had been handled so as to prevnt to handle them again while looping through the undamaged objects later on. However, this case never occurred because the damaged and undamaged objects are in a different arrays, so this bool property was obsolete from the beginning, and since UFO4P 2.0.4, it isn't used anymore at all.

We're now using this bool to flag the objects once they are unassigned.