Skip to content

Commit

Permalink
Reset more character stats to zero for testing
Browse files Browse the repository at this point in the history
Call player::environmental_revert_effect to remove addictions to e.g.
prevent opiate withdrawal from causing unexpected random pain in tests.
  • Loading branch information
wapcaplet authored and olanti-p committed Dec 17, 2020
1 parent 55e6300 commit d27cee3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/player_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ void clear_character( player &dummy, bool debug_storage )
item food( "debug_nutrition" );
dummy.eat( food );

// This sets HP to max, clears addictions and morale,
// and sets hunger, thirst, fatigue and such to zero
dummy.environmental_revert_effect();

dummy.empty_skills();
dummy.clear_morale();
dummy.clear_bionics();
Expand All @@ -97,9 +101,6 @@ void clear_character( player &dummy, bool debug_storage )
dummy.set_dex_bonus( 0 );
dummy.set_int_bonus( 0 );
dummy.set_per_bonus( 0 );
dummy.reset_bonuses();
dummy.set_speed_base( 100 );
dummy.set_speed_bonus( 0 );

dummy.cash = 0;

Expand Down

0 comments on commit d27cee3

Please sign in to comment.