From 8fbaefddc07cbd9e721f9bb4f5045693ada756b6 Mon Sep 17 00:00:00 2001 From: luk3yx Date: Wed, 3 Jul 2019 07:38:52 +1200 Subject: [PATCH] Fix warning when the IRC mod isn't installed --- init.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index 7aa198e..7c78f93 100755 --- a/init.lua +++ b/init.lua @@ -1,18 +1,18 @@ -- Reboot mod for Minetest -- Waits for the last player to leave then shuts the server down --- +-- -- Copyright © 2018 by luk3yx --- +-- -- Permission is hereby granted, free of charge, to any person obtaining a copy -- of this software and associated documentation files (the "Software"), to deal -- in the Software without restriction, including without limitation the rights -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -- copies of the Software, and to permit persons to whom the Software is -- furnished to do so, subject to the following conditions: --- +-- -- The above copyright notice and this permission notice shall be included in -- all copies or substantial portions of the Software. --- +-- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -28,7 +28,9 @@ local checkReboot checkReboot = function() if reboot and next(minetest.get_connected_players()) == nil then -- Time to reboot - if irc then irc.say("The server is empty! Rebooting...") end + if minetest.global_exists('irc') then + irc.say("The server is empty! Rebooting...") + end minetest.request_shutdown("Rebooting...", true, 1) end end