1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-16 02:47:48 +02:00

Merge branch 'develop' of github.com:Gerkiz/ComfySA into develop

This commit is contained in:
Gerkiz 2024-09-26 17:44:36 +02:00
commit b8227a6a30
6 changed files with 30 additions and 19 deletions

View File

@ -1616,7 +1616,7 @@ function Public.check_for_cliff_explosives_in_hold_wooden_chests()
else
local tick_tacks = { '*tick*', '*tick*', '*tack*', '*tak*', '*tik*', '*tok*' }
for _, player in pairs(game.players) do
for _, player in pairs(game.connected_players) do
if player.surface_index == surface.index then
player.create_local_flying_text(
{

View File

@ -194,7 +194,7 @@ function Public.parrot_speak(force, message)
end
function Public.flying_text(surface, position, text)
for _, player in pairs(game.players) do
for _, player in pairs(game.connected_players) do
if player.surface_index == surface.index then
player.create_local_flying_text {
position = { position.x - 0.7, position.y - 3.05 },
@ -205,7 +205,7 @@ function Public.flying_text(surface, position, text)
end
function Public.flying_text_small(surface, position, text) --differs just in the location of the text, more suitable for small things like '+'
for _, player in pairs(game.players) do
for _, player in pairs(game.connected_players) do
if player.surface_index == surface.index then
player.create_local_flying_text {
position = { position.x - 0.08, position.y - 1.5 },

View File

@ -241,7 +241,20 @@ function Public.join_spectators(player, crewid)
-- -- Server.to_discord_embed_raw(CoreData.comfy_emojis.feel .. '[' .. memory.name .. '] ' .. message)
-- end
-- Common.send_important_items_from_player_to_crew(player, true)
local player_surface_type = SurfacesCommon.decode_surface_name(player.surface.name).type
local boat_surface_type = SurfacesCommon.decode_surface_name(memory.boat.surface_name).type
if not memory.temporarily_logged_off_player_data then memory.temporarily_logged_off_player_data = {} end
memory.temporarily_logged_off_player_data[player.index] = {
on_island = (player_surface_type == Surfaces.enum.ISLAND),
on_boat = (player_surface_type == boat_surface_type) and Boats.on_boat(memory.boat, player.character.position),
surface_name = player.surface.name,
position = player.character.position,
tick = game.tick
}
Common.temporarily_store_logged_off_character_items(player)
char.die(memory.force_name)
@ -451,19 +464,17 @@ function Public.leave_crew(player, to_lobby, quiet)
-- @TODO: figure out why surface_name can be nil
if not to_lobby then
if not memory.temporarily_logged_off_player_data then memory.temporarily_logged_off_player_data = {} end
if not memory.temporarily_logged_off_player_data then memory.temporarily_logged_off_player_data = {} end
memory.temporarily_logged_off_player_data[player.index] = {
on_island = (player_surface_type == Surfaces.enum.ISLAND),
on_boat = (player_surface_type == boat_surface_type) and Boats.on_boat(memory.boat, player.character.position),
surface_name = player.surface.name,
position = player.character.position,
tick = game.tick
}
memory.temporarily_logged_off_player_data[player.index] = {
on_island = (player_surface_type == Surfaces.enum.ISLAND),
on_boat = (player_surface_type == boat_surface_type) and Boats.on_boat(memory.boat, player.character.position),
surface_name = player.surface.name,
position = player.character.position,
tick = game.tick
}
Common.temporarily_store_logged_off_character_items(player)
end
Common.temporarily_store_logged_off_character_items(player)
char.die(memory.force_name)

View File

@ -40,7 +40,7 @@ local function create_flying_text(surface, position, text)
return
end
for _, player in pairs(game.players) do
for _, player in pairs(game.connected_players) do
if player.surface_index == surface.index then
player.create_local_flying_text(
{
@ -64,7 +64,7 @@ local function create_kaboom(force_name, surface, position, name)
local target = position
local speed = 0.5
if name == 'defender-capsule' or name == 'destroyer-capsule' or name == 'distractor-capsule' then
for _, player in pairs(game.players) do
for _, player in pairs(game.connected_players) do
if player.surface_index == surface.index then
player.create_local_flying_text(
{

View File

@ -93,7 +93,7 @@ local function create_floaty_text(surface, position, name, count)
if not surface.valid then return end
for _, player in pairs(game.players) do
for _, player in pairs(game.connected_players) do
if player.surface_index == surface.index then
player.create_local_flying_text(
{

View File

@ -57,7 +57,7 @@ local function on_entity_damaged(event)
if not surface.valid then return end
if math_random(1, 5) == 1 then
for _, player in pairs(game.players) do
for _, player in pairs(game.connected_players) do
if player.surface_index == event.cause.surface_index then
player.create_local_flying_text(
{