Page 1 of 1

14.22 Revive() a ghost with 0 health gives repair pack alert

Posted: Thu Apr 13, 2017 6:08 am
by Nexela
Change the max_health value for the constant-combinator in prototype files to 0

Equip personal roboport or stand in construction zone and Create a ghost of the entity
/c local player, pos = game.player, game.player.position player.surface.create_entity{name="entity-ghost", position = pos, force = player.force, inner_name="constant-combinator"}
select and revive the ghost with /c game.player.selected.revive()

Notice repair pack alert.

Workaround:
Setting the health to 1 after reviving causes the alert to go away. /c game.player.selected.health = 1

Re: 14.22 Revive() a ghost with 0 health gives repair pack alert

Posted: Fri Apr 14, 2017 1:55 am
by DaveMcW
Should max_health=0 even be allowed for an "entity with health"?

Re: 14.22 Revive() a ghost with 0 health gives repair pack alert

Posted: Fri Apr 14, 2017 10:30 am
by Rseding91
DaveMcW wrote:Should max_health=0 even be allowed for an "entity with health"?
No. It would cause division by zero in several places we manipulate health. I'll fix it for 0.15.

Re: 14.22 Revive() a ghost with 0 health gives repair pack alert

Posted: Fri Apr 14, 2017 2:56 pm
by BenSeidel
How do you kill that with no life?