Skip to content

Commit

Permalink
Merge pull request #34283 from CleverRaven/revert-31635-fix-bionic-po…
Browse files Browse the repository at this point in the history
…wer-savegame-loading

Revert "Fix bionic power loading from corrupted savegames"
  • Loading branch information
ZhilkinSerg authored Sep 28, 2019
2 parents 832c578 + 76d4989 commit e6a7a7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 1 addition & 3 deletions src/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ JsonObject::JsonObject( JsonIn &j )
while( !jsin->end_object() ) {
std::string n = jsin->get_member_name();
int p = jsin->tell();
// FIXME: Fix corrupted bionic power data loading (see #31627). Temporary.
if( n != "//" && n != "comment" && n != "power_level" && n != "max_power_level" &&
positions.count( n ) > 0 ) {
if( n != "//" && n != "comment" && positions.count( n ) > 0 ) {
// members with name "//" or "comment" are used for comments and
// should be ignored anyway.
j.error( "duplicate entry in json object" );
Expand Down
9 changes: 2 additions & 7 deletions src/savegame_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,6 @@ void Character::load( JsonObject &data )
_skills->clear();
JsonObject pmap = data.get_object( "skills" );
for( const std::string &member : pmap.get_member_names() ) {
// FIXME: Fix corrupted bionic power data loading (see #31627). Temporary.
if( member == "power_level" || member == "max_power_level" ) {
continue;
}
pmap.read( member, ( *_skills )[skill_id( member )] );
}

Expand All @@ -505,9 +501,8 @@ void Character::load( JsonObject &data )
recalc_sight_limits();
reset_encumbrance();

// FIXME: Fix corrupted bionic power data loading (see #31627). Temporary.
power_level = pmap.get_int( "power_level", data.get_int( "power_level", 0 ) );
max_power_level = pmap.get_int( "max_power_level", data.get_int( "max_power_level", 0 ) );
data.read( "power_level", power_level );
data.read( "max_power_level", max_power_level );
// Bionic power scale has been changed, savegame version 21 has the new scale
if( savegame_loading_version <= 20 ) {
power_level *= 25;
Expand Down

0 comments on commit e6a7a7c

Please sign in to comment.