1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-03-25 21:29:06 +02:00

Towny - small fix

This commit is contained in:
Gerkiz 2022-10-21 22:13:11 +02:00
parent ed756e4f52
commit 764a237e3e

View File

@ -242,7 +242,44 @@ commands.add_command(
else
game.print(mapkeeper .. ' server, has reset the game!', {r = 0.98, g = 0.66, b = 0.22})
end
has_the_game_ended()
for _, player in pairs(game.players) do
local frame = this.score_gui_frame[player.index]
if frame and frame.valid then
frame.destroy()
end
end
this.game_reset_tick = nil
this.game_won = false
ScenarioTable.reset_table()
local surface = game.surfaces['nauvis']
if get_victorious_force() then
surface.play_sound({path = 'utility/game_won', volume_modifier = 1})
else
surface.play_sound({path = 'utility/game_lost', volume_modifier = 1})
end
game.reset_time_played()
game.reset_game_state()
for _, player in pairs(game.players) do
player.teleport({0, 0}, game.surfaces['limbo'])
end
Nauvis.initialize()
Team.initialize()
if game.forces['rogue'] == nil then
log('rogue force is missing!')
end
for _, player in pairs(game.players) do
Player.increment()
Player.initialize(player)
Team.set_player_color(player)
Player.spawn(player)
Player.load_buffs(player)
Player.requests(player)
end
Alert.alert_all_players(5, 'The world has been reset!', Color.white, 'restart_required', 1.0)
game.print('The world has been reset!', {r = 0.22, g = 0.88, b = 0.22})
Server.to_discord_embed('*** The world has been reset! ***')
p('[WARNING] Game has been reset!')
return
end