[posila][0.17.60] Setting the health of an item-with-entity-data to 1.0 doesn't update the item's health

This subforum contains all the issues which we already resolved.
calcwizard
Burner Inserter
Burner Inserter
Posts: 16
Joined: Sat Apr 20, 2019 6:30 am
Contact:

[posila][0.17.60] Setting the health of an item-with-entity-data to 1.0 doesn't update the item's health

Post by calcwizard »

Setting an ItemStack's health to 1.0 via script or command doesn't update the ItemStack's health if the item in question is an item-with-entity-data. Setting the health to any other value works as expected, including setting it from 1.0 to something else, and setting any other item's health to 1.0 also works as expected.

This bug can be reproduced by placing a car in the player's inventory and running the following command, which damages the car and then tries to set the health back to 1.0. It instead leaves the car at 0.2 health. If used on an item without entity data the item is restored to full health.

Code: Select all

/c game.player.get_main_inventory().find_item_stack("car").health = .2
game.player.get_main_inventory().find_item_stack("car").health = 1
Attachments
0.17.60 item health command bug.zip
here's a save with a car in the player's inventory after the command was entered
(1.33 MiB) Downloaded 126 times
factorio-current.log
(7.03 KiB) Downloaded 119 times
posila
Factorio Staff
Factorio Staff
Posts: 5362
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [posila][0.17.60] Setting the health of an item-with-entity-data to 1.0 doesn't update the item's health

Post by posila »

Thank you for taking the time to write up the bug report.

Fixed for 0.17.61
Post Reply

Return to “Resolved Problems and Bugs”