[Tobias][1.1.74] on_entity_renamed for a train stop doesn't contain player_index when triggered by copy paste

This subforum contains all the issues which we already resolved.
User avatar
EvilPLa
Inserter
Inserter
Posts: 22
Joined: Sat Nov 14, 2020 7:26 am
Contact:

[Tobias][1.1.74] on_entity_renamed for a train stop doesn't contain player_index when triggered by copy paste

Post by EvilPLa »

Hello,
when I copy a Train stop name via Shift-click or via CTRL-C blueprint onto another stop, the resulting on_entity_renamed event does not contain the player_index field in the EventData.
The following code:

Code: Select all

script.on_event(defines.events.on_entity_renamed, function (event)
    log("------ on_entity_renamed -------")
    log("---- TYPE : " .. event.entity.type)
    log(serpent.block(event))
end)
Produces this log:

Code: Select all

  96.603 Script @__test__/control.lua:3: ------ on_entity_renamed -------
  96.603 Script @__test__/control.lua:4: ---- TYPE : train-stop
  96.603 Script @__test__/control.lua:5: {
  by_script = false,
  entity = {
    __self = "userdata"
  },
  name = 59,
  old_name = "Igor Timurov",
  player_index = 1,
  tick = 3130
}
 106.387 Script @__test__/control.lua:3: ------ on_entity_renamed -------
 106.387 Script @__test__/control.lua:4: ---- TYPE : train-stop
 106.388 Script @__test__/control.lua:5: {
  by_script = false,
  entity = {
    __self = "userdata"
  },
  name = 59,
  old_name = "Nicolas the Hamstroll",
  tick = 3717
}
First event: rename a train stop via gui
then I buld another stop and SHIFT-right click the first stop
Second event: paste the data to the second stop with SHIFT-left click

Then I did the same with a spidertron and the second event had the player_index in the EvenData as expected, that is in the log too
Attachments
test_0.1.0.zip
test mod
(571 Bytes) Downloaded 79 times
Test.zip
Savegame
(1.09 MiB) Downloaded 82 times
factorio-current.log
(6.93 KiB) Downloaded 75 times
I havent lost my mind, it's backed up on tape somewhere.
Tobias1595
Factorio Staff
Factorio Staff
Posts: 40
Joined: Sat Sep 29, 2018 5:28 pm
Contact:

Re: [Tobias][1.1.74] on_entity_renamed for a train stop doesn't contain player_index when triggered by copy paste

Post by Tobias1595 »

Thanks for the report. A fix will be included in the next release.
Post Reply

Return to “Resolved Problems and Bugs”