Skip to content

Commit

Permalink
Remove vitamin deficiency effects on load (#49265)
Browse files Browse the repository at this point in the history
After #49083, effects will no longer be applied for most vitamin
deficiencies... or lost when no longer valid. Since they don't do
anything, let's remove them on load and not leave saves with an effect
that does nothing sticking around.
  • Loading branch information
anothersimulacrum authored Jun 12, 2021
1 parent 0593801 commit a76f7e8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/savegame_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3361,6 +3361,19 @@ void Creature::load( const JsonObject &jsin )
} else {
jsin.read( "effects", *effects );
}

// Remove legacy vitamin effects - they don't do anything, and can't be removed
// Remove this code whenever they actually do anything (0.F or later)
std::set<efftype_id> blacklisted = {
efftype_id( "hypocalcemia" ),
efftype_id( "hypovitA" ),
efftype_id( "hypovitB" ),
efftype_id( "scurvy" )
};
for( const efftype_id &remove : blacklisted ) {
remove_effect( remove );
}

jsin.read( "values", values );

jsin.read( "damage_over_time_map", damage_over_time_map );
Expand Down

0 comments on commit a76f7e8

Please sign in to comment.