Skip to content

Commit be34abe

Browse files
committed
BUGFIX:
- /mission rollback: active mission check did not work, if you were in .dcssb
1 parent 8a34b84 commit be34abe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plugins/mission/commands.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -742,17 +742,17 @@ async def rollback(self, interaction: discord.Interaction,
742742
await interaction.followup.send(_("No mission found."), ephemeral=True)
743743
return
744744
filename = missions[mission_id]
745-
if server.status in [Status.RUNNING, Status.PAUSED] and filename == server.current_mission.filename:
746-
await interaction.followup.send(_("Please stop your server first to rollback the running mission."),
747-
ephemeral=True)
748-
return
749745
if '.dcssb' in filename:
750746
new_file = os.path.join(os.path.dirname(filename).replace('.dcssb', ''),
751747
os.path.basename(filename))
752748
orig_file = filename + '.orig'
753749
else:
754750
new_file = filename
755751
orig_file = os.path.join(os.path.dirname(filename), '.dcssb', os.path.basename(filename)) + '.orig'
752+
if server.status in [Status.RUNNING, Status.PAUSED] and new_file == server.current_mission.filename:
753+
await interaction.followup.send(_("Please stop your server first to rollback the running mission."),
754+
ephemeral=True)
755+
return
756756
try:
757757
await server.node.rename_file(orig_file, new_file, force=True)
758758
except FileNotFoundError:

0 commit comments

Comments
 (0)