mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-08 00:39:30 +02:00
commit
07165686dc
@ -706,6 +706,10 @@ function Public.remove_offline_players()
|
||||
player_inv[3] = game.players[offline_players[i].index].get_inventory(defines.inventory.character_guns)
|
||||
player_inv[4] = game.players[offline_players[i].index].get_inventory(defines.inventory.character_ammo)
|
||||
player_inv[5] = game.players[offline_players[i].index].get_inventory(defines.inventory.character_trash)
|
||||
if not next(player_inv) then
|
||||
offline_players[i] = nil
|
||||
break
|
||||
end
|
||||
local pos = game.forces.player.get_spawn_position(surface)
|
||||
local e =
|
||||
surface.create_entity(
|
||||
|
@ -347,7 +347,7 @@ local function kick_players_from_surface(ic, car)
|
||||
if not car.entity or not car.entity.valid then
|
||||
local main_surface = game.surfaces[ic.allowed_surface]
|
||||
if validate_entity(main_surface) then
|
||||
for _, e in pairs(car.surface.find_entities_filtered({area = car.area})) do
|
||||
for _, e in pairs(surface.find_entities_filtered({area = car.area})) do
|
||||
if validate_entity(e) and e.name == 'character' and e.player then
|
||||
e.player.teleport(main_surface.find_non_colliding_position('character', game.forces.player.get_spawn_position(main_surface), 3, 0, 5), main_surface)
|
||||
end
|
||||
@ -645,6 +645,10 @@ function Public.kill_car(ic, entity)
|
||||
end
|
||||
|
||||
local car = ic.cars[entity.unit_number]
|
||||
if not car then
|
||||
return
|
||||
end
|
||||
|
||||
local surface_index = car.surface
|
||||
local surface = game.surfaces[surface_index]
|
||||
kick_players_out_of_vehicles(car)
|
||||
|
Loading…
Reference in New Issue
Block a user