Auto Fish and Heal


Automatically eats fish (or similar fish-like healing capsules) when taking damage. No special equipment required. Supports medpacks from Space Exploration and first aid kits from Krastorio2.

Utilities
2 years ago
1.1
1.35K

b Throwing grenades under player feet

1 year, 8 months ago

Hello! Got a bug. If I am holding grenade in cursor (which happens a lot in a fight, grab grenade-shoot/throw), when mod uses healing kit from SE it throws held grenade (or a capsule) under player's feet.

1 year, 7 months ago

I haven't been able to replicate this. How often does it happen and under which circumstances? How many stacks of medpacks/fish/grenades do you have and what else is in the inventory?

Only ideas I have currently is that either swap_stack fails for some reason and mod tries to heal player with a grenade :)
Or item stack (e.g. grenades) runs out and there's issue with stack index, but I'm not sure if that can even happen during script execution.

  local cursor = player.cursor_stack
  cursor.swap_stack(fish)
  player.use_from_cursor(player.position)
  fish.swap_stack(cursor)

https://katiska.cc/temp/factorio/mods/autofish-grenade.mp4

1 year, 6 months ago

Well that's strange, I'm playing with a lot of mods now. In my current save bug is reproduced every time (tried without armor to eliminate any modded equipment influence).
Start new game in sandbox mode - everything is ok.
And by the way I got healed and grenaded both at the same time, not grenade instead of heal.
Will try some more tests if I can make then up.

New response