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.