1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-01-30 04:30:58 +02:00

Fix train station names

This commit is contained in:
Matthew Heguy 2018-11-27 05:35:51 -05:00
parent bdc5d2ae77
commit 1d4acc8e35

View File

@ -1,5 +1,4 @@
local Event = require 'utils.event'
local Game = require 'utils.game'
local function player_built_entity(event)
local entity = event.created_entity
@ -10,8 +9,7 @@ local function player_built_entity(event)
if entity.name == 'train-stop' then
local y = math.random(1, 3)
if y ~= 1 then
local x = table.get_random(game.players, true)
local player = Game.get_player_by_index(x)
local player = table.get_random(game.players, true)
event.created_entity.backer_name = player.name
end
end