Npc can handle multipe power gen cbm #35601
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Bugfixes "Npc can handle multipe power gen cbm"
Purpose of change
Npc can handle multipe power gen cbm
Fixes #35559
Internal Furnace CBM is NPC useable
Describe the solution
Fix
wants_to_recharge_cbm()
andrecharge_cbm()
logic to handle having multiple power gen CBMsAdd "BIONIC_NPC_USABLE" flag to Internal Furnace since it already has code to handle useage by NPCs
Describe alternatives you've considered
Testing
Get NPC
Give power bank Mk2, Laser finger, ethanol burner
NPC ask for ethanol,
Give ethanol
NPC refuel CBM
wait
Ethanol Burner turns off
wait
No message, no crash
Spawn Z
NPC shoots Z
Turns ethanol burner on
Power is recharged
Turns ethanol burner off
Install Battery system
No infinite loop
Spawn Z/NPC shoots
NPC ask for battery and turns on ethanol burner
wait
Power goes up
wait, no complain, no infinite loop
Spawn new NPC
Give power bank and internal furnace
NPC ask for junk
Give plank
NPC recharge 70 kJ with plank
Give another
Same
Additional context
NPC will use the first CBM with fuel