Permalink
Browse files

clear_player (test helper) now clears bionics

This avoids a rare crafting test failure where it becomes confused
because the player has an integrated toolset and that is an alternative
tool to the one the test intended to be used.
  • Loading branch information...
jbytheway committed Jan 3, 2019
1 parent e354022 commit 072e35f476cb2b412be6f6a585ec42a34dd9fbb8
Showing with 9 additions and 0 deletions.
  1. +5 −0 src/bionics.cpp
  2. +2 −0 src/player.h
  3. +2 −0 tests/player_helpers.cpp
@@ -1373,6 +1373,11 @@ bool player::remove_random_bionic()
return numb;
}

void player::clear_bionics()
{
my_bionics->clear();
}

void reset_bionics()
{
bionics.clear();
@@ -331,6 +331,8 @@ class player : public Character
void process_bionic( int b );
/** Randomly removes a bionic from my_bionics[] */
bool remove_random_bionic();
/** Remove all bionics */
void clear_bionics();
/** Returns the size of my_bionics[] */
int num_bionics() const;
/** Returns amount of Storage CBMs in the corpse **/
@@ -39,6 +39,8 @@ void clear_player()
dummy.set_mutation( trait_id( "DEBUG_STORAGE" ) );
}

dummy.clear_bionics();

// Make stats nominal.
dummy.str_cur = 8;
dummy.dex_cur = 8;

0 comments on commit 072e35f

Please sign in to comment.