Skip to content

Commit

Permalink
Avoid time rewind in npc test (CleverRaven#52156)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettDong authored Oct 7, 2021
1 parent 8cdc540 commit 0953a04
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/npc_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,14 @@ TEST_CASE( "npc-movement" )

TEST_CASE( "npc_can_target_player" )
{
time_point noon = calendar::turn - time_past_midnight( calendar::turn ) + 12_hours;
if( noon < calendar::turn ) {
noon = noon + 1_days;
}
REQUIRE( time_past_midnight( noon ) == 12_hours );
REQUIRE( noon >= calendar::turn );
// Set to daytime for visibiliity
calendar::turn = calendar::turn_zero + 12_hours;
calendar::turn = noon;

g->faction_manager_ptr->create_if_needed();

Expand Down

0 comments on commit 0953a04

Please sign in to comment.