Skip to content

Commit

Permalink
Avoid ever-growing world names from the V2 conversion
Browse files Browse the repository at this point in the history
  Ask the user to rename the backup world before they
  attempt another conversion.

Signed-off-by: David Li <jiawei.davidli@gmail.com>
  • Loading branch information
randombk committed Jan 19, 2025
1 parent 76aaee2 commit 6ef7fc4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/worldfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,11 @@ void worldfactory::convert_to_v2( const std::string &worldname )
}

// Backup the world by renaming it to a new name
if( worldname.find( " (V2 Conversion Backup)" ) != std::string::npos ) {
popup( _( "World '%s' is already a backup. Rename the world before trying again." ), worldname );
return;
}

std::string backup_name = worldname + " (V2 Conversion Backup)";
if( has_world( backup_name ) ) {
popup( _( "Backup world '%s' already exists, aborting conversion" ), backup_name );
Expand Down

0 comments on commit 6ef7fc4

Please sign in to comment.