Skip to content

Commit

Permalink
Improve message when can't /save due to saving changes to the level b…
Browse files Browse the repository at this point in the history
…eing disabled, also log message when a game round is started for all games instead of just lava survival
  • Loading branch information
UnknownShadow200 committed Nov 20, 2022
1 parent 1612526 commit a7da4b8
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion MCGalaxy/Commands/World/CmdSave.cs
Expand Up @@ -60,7 +60,7 @@ public sealed class CmdSave : Command2 {
if (!force && !lvl.Changed) return false;

if (!lvl.SaveChanges) {
p.Message("Level {0} &Sis running a game, skipping save", lvl.ColoredName);
p.Message("Saving {0} &Sis currently disabled (most likely because a game is or was running on the level)", lvl.ColoredName);
return false;
}

Expand Down
2 changes: 0 additions & 2 deletions MCGalaxy/Games/IGame.cs
Expand Up @@ -16,8 +16,6 @@
permissions and limitations under the Licenses.
*/
using System;
using System.Collections.Generic;
using MCGalaxy.Commands.World;

namespace MCGalaxy.Games
{
Expand Down
1 change: 0 additions & 1 deletion MCGalaxy/Games/LavaSurvival/LSGame.Round.cs
Expand Up @@ -28,7 +28,6 @@ public sealed partial class LSGame : RoundsGame {
ResetPlayerDeaths();
RoundStart = DateTime.UtcNow;
RoundInProgress = true;
Logger.Log(LogType.GameActivity, "[Lava Survival] Round started. Map: " + Map.ColoredName);

Map.SetPhysics(destroyMode ? 2 : 1);
int secs = 0, layerSecs = 0;
Expand Down
3 changes: 2 additions & 1 deletion MCGalaxy/Games/RoundsGame/RoundsGame.cs
Expand Up @@ -104,7 +104,8 @@ public abstract partial class RoundsGame : IGame {
while (Running && RoundsLeft > 0) {
RoundInProgress = false;
if (RoundsLeft != int.MaxValue) RoundsLeft--;


if (Map != null) Logger.Log(LogType.GameActivity, "[{0}] Round started on {1}", GameName, Map.ColoredName);
DoRound();
if (Running) EndRound();
if (Running) VoteAndMoveToNextMap();
Expand Down
2 changes: 1 addition & 1 deletion MCGalaxy/Levels/Level.cs
Expand Up @@ -158,7 +158,7 @@ public sealed partial class Level : IDisposable
bool cancel = false;
OnLevelUnloadEvent.Call(this, ref cancel);
if (cancel) {
Logger.Log(LogType.SystemActivity, "Unload canceled by Plugin! (Map: {0})", name);
Logger.Log(LogType.SystemActivity, "Unloading of {0} canceled by a plugin", name);
return false;
}
MovePlayersToMain();
Expand Down

0 comments on commit a7da4b8

Please sign in to comment.