Closed belettee closed 4 months ago
This should be no problem to implement, and thanks for submitting the PR. Once the SPT hub is accessible, I'll post the 0.5.0 release, and then I'll include this PR into the 0.5.1 release in a couple weeks.
@belettee Not sure if you get automatic emails for releases now, but your PR is included in the new alpha build: https://github.com/dwesterwick/SPTQuestingBots/releases/tag/0.5.1-alpha1
Hope everything works for you! Thanks again for the PR!
Hey Dan, thank you for your work, I'm a huge fan of the mod!
I'm running the mod in a setting where
BotsController.AddActivePLayer
will be called multiple times, but the code doesn't expect that at the moment and throws an error. If you're open to it, I'd like to useGetOrAddComponent
instead ofAddComponent
in places where you're looking to have only one instance of a component.AddActivePlayerPatch
then becomes idempotent.Explanation of the error: QB's
LocationData
component is created whenBotsController.AddActivePLayer
is called. We need to call that function several times, which calls theBotHiveMindMonitor
constructor multiple times, which tries to add the same key to the staticBotHiveMindMonitor.sensors
multiple times. This patch makes it so we do not createLocationData
and other components again if they already exist.Stacktrace of the error: