raiguard / MouseOverConstruction

MIT License
2 stars 1 forks source link

Free upgrades! Replacement items not removed from inventory. #1

Closed okradonkey closed 3 years ago

okradonkey commented 3 years ago

Describe the Bug

Mouseover upgrade planner is free; installed items are not removed after upgrading via upgrade planner + mouseover.

To Reproduce

This applies to any items, but we'll use belts for this example.

  1. Acquire 5 yellow belts and 5 red belts
  2. Install a row of 5 yellow belts
  3. Use the upgrade planner to mark yellow belts for upgrade to red belts
  4. Mouseover the yellow belts, upgrading them to red belts
  5. The 5 red belts are installed. In your inventory, you now have 5 yellow belts AND 5 red belts.
  6. The 5 red belts should have been removed from your inventory.

Proposed solution:

In control.lua, in the upgrading section (approximately line 85), add the following line to remove the upgraded item after a successful upgrade. I believe this will solve the issue. Thanks!

                if upgraded_entity then
                  player.play_sound{
                    path = "entity-build/"..upgraded_entity.name,
                    position = upgraded_entity.position
                  }
>>>               inventory.remove(use_item)
                end
raiguard commented 3 years ago

How did I forget that? Thanks, fixed for the next release.