Skip to content

Commit

Permalink
use data.read and remove was_loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
KorGgenT committed Jan 4, 2020
1 parent d538dc4 commit e898705
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/item_contents.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ class item_contents

void serialize( JsonOut &json ) const;
void deserialize( JsonIn &jsin );

bool was_loaded;
private:
// gets the pocket described as legacy, or creates one
item_pocket &legacy_pocket();
Expand Down
2 changes: 0 additions & 2 deletions src/item_pocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ class item_pocket
void deserialize( JsonIn &jsin );

bool operator==( const item_pocket &rhs ) const;

bool was_loaded;
private:
const pocket_data *data = nullptr;
// the items inside the pocket
Expand Down
4 changes: 2 additions & 2 deletions src/savegame_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void item_contents::serialize( JsonOut &json ) const
void item_contents::deserialize( JsonIn &jsin )
{
JsonObject data = jsin.get_object();
optional( data, was_loaded, "contents", contents );
data.read( "contents", contents );
}

void item_pocket::serialize( JsonOut &json ) const
Expand All @@ -178,7 +178,7 @@ void item_pocket::serialize( JsonOut &json ) const
void item_pocket::deserialize( JsonIn &jsin )
{
JsonObject data = jsin.get_object();
optional( data, was_loaded, "contents", contents );
data.read( "contents", contents );
}

std::vector<item> item::magazine_convert()
Expand Down

0 comments on commit e898705

Please sign in to comment.