From 2360b0f09782f630d805ed3d428b3fef91d5aaf1 Mon Sep 17 00:00:00 2001 From: andrei Date: Sun, 17 Nov 2024 20:46:40 +0200 Subject: [PATCH] tests/eoc: use standard NPC --- tests/eoc_test.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/eoc_test.cpp b/tests/eoc_test.cpp index 3c2918c1c7a86..413ec2c74aae0 100644 --- a/tests/eoc_test.cpp +++ b/tests/eoc_test.cpp @@ -1457,18 +1457,14 @@ TEST_CASE( "EOC_run_eocs", "[eoc]" ) clear_avatar(); clear_map(); clear_npcs(); - shared_ptr_fast guy = make_shared_fast(); - 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 ); @@ -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{} );