Skip to content

Commit

Permalink
Merge pull request #1 from Trioct/fix-pr-errors
Browse files Browse the repository at this point in the history
fix errors
  • Loading branch information
Xpyder committed Oct 6, 2020
2 parents 4d3520e + 45a2388 commit 1f5b5b0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/character.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ struct weariness_tracker {
int tick_counter = 0;

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

inline social_modifiers operator+( social_modifiers lhs, const social_modifiers &rhs )
Expand Down
19 changes: 19 additions & 0 deletions src/savegame_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,25 @@ void consumption_event::deserialize( JsonIn &jsin )
jo.read( "component_hash", component_hash );
}

void weariness_tracker::serialize( JsonOut &json ) const
{
json.start_object();
json.member( "tracker", tracker );
json.member( "intake", intake );
json.member( "low_activity_ticks", low_activity_ticks );
json.member( "tick_counter", tick_counter );
json.end_object();
}

void weariness_tracker::deserialize( JsonIn &jsin )
{
JsonObject jo = jsin.get_object();
jo.read( "tracker", tracker );
jo.read( "intake", intake );
jo.read( "low_activity_ticks", low_activity_ticks );
jo.read( "tick_counter", tick_counter );
}

/**
* Gather variables for saving. These variables are common to both the avatar and NPCs.
*/
Expand Down

0 comments on commit 1f5b5b0

Please sign in to comment.