Fix warning when the IRC mod isn't installed

This commit is contained in:
luk3yx 2019-07-03 07:38:52 +12:00
parent 8a738f72fb
commit 8fbaefddc0
1 changed files with 7 additions and 5 deletions

View File

@ -1,18 +1,18 @@
-- Reboot mod for Minetest -- Reboot mod for Minetest
-- Waits for the last player to leave then shuts the server down -- Waits for the last player to leave then shuts the server down
-- --
-- Copyright © 2018 by luk3yx -- Copyright © 2018 by luk3yx
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a copy -- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal -- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights -- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is -- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions: -- furnished to do so, subject to the following conditions:
-- --
-- The above copyright notice and this permission notice shall be included in -- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software. -- all copies or substantial portions of the Software.
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@ -28,7 +28,9 @@ local checkReboot
checkReboot = function() checkReboot = function()
if reboot and next(minetest.get_connected_players()) == nil then if reboot and next(minetest.get_connected_players()) == nil then
-- Time to reboot -- 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) minetest.request_shutdown("Rebooting...", true, 1)
end end
end end