mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-01-03 22:52:13 +02:00
keep the player's character
This commit is contained in:
parent
6ad2be252c
commit
4b6c24ce6a
@ -5,7 +5,7 @@ local drivers_group = 'Drivers'
|
||||
local random = math.random
|
||||
|
||||
local function transfer_body(player)
|
||||
-- Remove the player from their character and place them in a car.
|
||||
--Place player in a car.
|
||||
local surface = player.surface
|
||||
local force = player.force
|
||||
local pos = force.get_spawn_position(surface)
|
||||
@ -13,11 +13,6 @@ local function transfer_body(player)
|
||||
-- Choose a random direction for the car to face
|
||||
local dir = random(0, 7)
|
||||
|
||||
-- Remove the players' character
|
||||
if player.character then
|
||||
player.character.destroy()
|
||||
end
|
||||
|
||||
--Find a place for a car, place a car, and place fuel+ammo in it
|
||||
local car_pos = surface.find_non_colliding_position('car', pos, 0, 3)
|
||||
local car = surface.create_entity {name = 'car', position = car_pos, direction = dir, force = force}
|
||||
|
Loading…
Reference in New Issue
Block a user