[0.17.58] corpse player_index is 1 higher after creation of corpse

This subforum contains all the issues which we already resolved.
Zerot
Burner Inserter
Burner Inserter
Posts: 5
Joined: Wed Dec 13, 2017 9:42 pm
Contact:

[0.17.58] corpse player_index is 1 higher after creation of corpse

Post by Zerot »

The following code should create a corpse with the player index of 1, but the resulting corpse has player index 2

Code: Select all

/c local c = game.player.surface.create_entity{name = "character-corpse", position = game.player.character.position, force = game.player.force, inventory_size = 0, player_index = 1}; game.print(c.character_corpse_player_index)
If I want to create a corpse for the local player, then I need to do `player_index = game.player.index - 1`.

This seems illogical to me.
I_IBlackI_I
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Wed Feb 20, 2013 6:57 pm
Contact:

Re: [0.17.58] corpse player_index is 1 higher after creation of corpse

Post by I_IBlackI_I »

Can confirm this is the case. The effect in single player is that it will create a character corpse, if you use index 0 (remember lua is 1 based indexing) it will create a I_IBlackI_I corpse.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14268
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.17.58] corpse player_index is 1 higher after creation of corpse

Post by Rseding91 »

Thanks for the report. It's now fixed for the next version of 0.17.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”