mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-03-25 21:29:06 +02:00
pirates: only check connected_players
This commit is contained in:
parent
ccf5fedf7b
commit
68c28f0a24
@ -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(
|
||||
{
|
||||
|
@ -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 },
|
||||
|
@ -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(
|
||||
{
|
||||
|
@ -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(
|
||||
{
|
||||
|
@ -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(
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user