Auto-healing effect can allow 2 medkit uses in certain situations

Digi shared this bug 13 hours ago
Submitted

This was discovered from the game code first then confirmed in-game: you need to get the auto-healing effect least once while you have no consumables, this assigns id 0 as that effect which is ignored by consumables. Next you need to be in an area that is not valid for auto-healing (below 75% env oxygen) and now you can consume 2 medkits one after the other in rapid succession, because one of them gets placed into that id 0 slot and is then ignored by the second medkit which adds its effect in id 1 (and a 3rd cannot be used).


Steps to repro:

1. Respawn or create a new starsystem world to spawn with space respawnship

2. Go outside and open your helmet until you reach below 70hp.

3. Go inside the ship, close the door and wait for the health to start regen.

4. Go outside and spawn yourself 10 medkits (alt+F10 enable creative tools, then close that and shift+F10 for spawn menu)

5. Pickup the medkits and in the inventory right-click it twice, you'll see that you were able to consume two (and their effects do stack, this part is not the core problem though).


The core issue is that consumables try to ignore this autoheal effect but the MySpaceStatEffect.GetAutoHealingEffect() does not properly return null when the effect is gone, making it assume any effect with that last stored id is the auto-healing one. Might be more reliable to have some optional custom name for effects, would be useful for mods too.

A sbc-only alternative fix would be to ensure all Health-stat consumables also give another stat, like Food, for the same duration as the health one.

Leave a Comment
 
Attach a file