Skip to content

Commit

Permalink
Merge pull request #77950 from andrei8l/eoc-test-npc-fixe
Browse files Browse the repository at this point in the history
tests/eoc: use standard NPC in the EOC_run_eocs test
  • Loading branch information
Night-Pryanik authored Nov 21, 2024
2 parents 7baf958 + 2360b0f commit a6beb86
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions tests/eoc_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1457,18 +1457,14 @@ TEST_CASE( "EOC_run_eocs", "[eoc]" )
clear_avatar();
clear_map();
clear_npcs();
shared_ptr_fast<npc> guy = make_shared_fast<npc>();
guy->normalize();
overmap_buffer.insert_npc( guy );
guy->spawn_at_precise( u.get_location() + tripoint_east );
g->load_npcs();
npc &guy = spawn_npc( u.pos_bub().xy() + point_east, "thug" );
tripoint_abs_ms mon_loc = u.get_location() + tripoint_west;
monster *zombie = g->place_critter_at( mon_zombie, get_map().bub_from_abs( mon_loc ) );
REQUIRE( zombie != nullptr );

item hammer( "hammer" );
item_location hammer_loc( map_cursor{ guy->get_location() }, &hammer );
dialogue d2( get_talker_for( *guy ), get_talker_for( hammer_loc ) );
item_location hammer_loc( map_cursor{ guy.get_location() }, &hammer );
dialogue d2( get_talker_for( guy ), get_talker_for( hammer_loc ) );
talker *alpha_talker = d2.actor( false );
talker *beta_talker = d2.actor( true );

Expand All @@ -1485,10 +1481,10 @@ TEST_CASE( "EOC_run_eocs", "[eoc]" )
CHECK( globvars.get_global_value( "beta_name" ) == alpha_talker->get_name() );

d2.set_value( "alpha_var", "avatar" );
d2.set_value( "beta_var", std::to_string( guy->getID().get_value() ) );
d2.set_value( "beta_var", std::to_string( guy.getID().get_value() ) );
CHECK( effect_on_condition_run_eocs_talker_mixes->activate( d2 ) );
CHECK( globvars.get_global_value( "alpha_name" ) == get_avatar().get_name() );
CHECK( globvars.get_global_value( "beta_name" ) == guy->get_name() );
CHECK( globvars.get_global_value( "beta_name" ) == guy.get_name() );

d2.set_value( "alpha_var", std::string{} );
d2.set_value( "beta_var", std::string{} );
Expand Down

0 comments on commit a6beb86

Please sign in to comment.