Fixed Existing Lua Check Errors

This commit is contained in:
Cooldude2606
2020-05-26 18:21:10 +01:00
parent 2aaeb06be3
commit 32507492b8
76 changed files with 1622 additions and 1617 deletions

View File

@@ -8,7 +8,7 @@ local config = require 'config.popup_messages' --- @dep config.popup_messages
local send_text = Game.print_player_floating_text -- (player_index, text, color)
Event.add(defines.events.on_console_chat,function(event)
Event.add(defines.events.on_console_chat, function(event)
if not event.player_index or event.player_index < 1 then return end
local player = Game.get_player_by_index(event.player_index)
@@ -18,7 +18,7 @@ Event.add(defines.events.on_console_chat,function(event)
-- Sends the message as text above them
if config.show_player_messages then
send_text(player.index,{'chat-popup.message',player.name,event.message},player.chat_color)
send_text(player.index, {'chat-popup.message', player.name, event.message}, player.chat_color)
end
if not config.show_player_mentions then return end
@@ -27,10 +27,10 @@ Event.add(defines.events.on_console_chat,function(event)
local search_string = event.message:lower():gsub("%s+", "")
-- Loops over online players to see if they name is included
for _,mentioned_player in pairs(game.connected_players) do
for _, mentioned_player in pairs(game.connected_players) do
if mentioned_player.index ~= player.index then
if search_string:match(mentioned_player.name:lower(), 1, true) then
send_text(mentioned_player.index,{'chat-popup.ping',player.name},player.chat_color)
send_text(mentioned_player.index, {'chat-popup.ping', player.name}, player.chat_color)
end
end
end