Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed DELETE_WORLD to WORLD_END. #23690

Merged
merged 4 commits into from May 17, 2018

Conversation

Projects
None yet
4 participants
@OzoneH3
Copy link
Member

commented May 8, 2018

Closes #23688

  • Added a simple function to migrate option names from configs.
  • Added functionality to migrate string choices.
@kevingranade

This comment has been minimized.

Copy link
Member

commented May 8, 2018

Please add "reset world" states to the option instead of removing the "delete world" states.
i.e. the option would look something like:

add( "WORLD_END", "world_default", translate_marker( "World end handling" ),
     translate_marker( "Handling of game world when last character dies." ),
     { { "keep", translate_marker( "Keep" ) }, { "reset", translate_marker( "Reset" ) },
       { "delete", translate_marker( "Delete" ) },  { "query", translate_marker( "Query" ) } }, "keep" );
src/options.cpp Outdated
add_retry(name, value);
options[ name ].setValue( value );
}
}

std::string options_manager::migrateOption( const std::string &name )
{
return !mMigrateOption[name].empty() ? mMigrateOption[name] : name;

This comment has been minimized.

Copy link
@BevapDin

BevapDin May 9, 2018

Contributor

Please don't query maps like that if the key may not be contained in it. This creates a key/value in the map. Use map::find to get an iterator to the existing entry:

const auto iter = mMigrateOption.find( name );
return iter != mMigrateOption.end() ? iter->second : name;

Than you can even make the function const, which it logically should be as it does not change the option_manager object.

@OzoneH3 OzoneH3 changed the title Changed DELETE_WORLD to RESET_WORLD. Changed DELETE_WORLD to WORLD_END. May 9, 2018

@OzoneH3 OzoneH3 force-pushed the OzoneH3:reset_world branch 2 times, most recently May 9, 2018

@OzoneH3

This comment has been minimized.

Copy link
Member Author

commented May 14, 2018

Jenkins rebuild

OzoneH3 added some commits May 8, 2018

Changed DELETE_WORLD to RESET_WORLD.
Added a simple function to migrate option names from configs.
Changed RESET_WORLD to WORLD_END and added delete world choice.
Added functionality to migrate string choices.

@OzoneH3 OzoneH3 force-pushed the OzoneH3:reset_world branch to a3ec191 May 14, 2018

@kevingranade kevingranade merged commit d8f81b7 into CleverRaven:master May 17, 2018

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.1%) to 23.79%
Details
gorgon-ghprb Build finished.
Details

@OzoneH3 OzoneH3 deleted the OzoneH3:reset_world branch Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.