Page 1 of 1

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

Posted: Thu Aug 01, 2019 1:16 pm
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

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

Posted: Thu Aug 01, 2019 2:16 pm
by posila
Thank you for taking the time to write up the bug report.

Fixed for 0.17.61