Skip to content

Commit

Permalink
Backporting #51460 Actually throttle monster thinking
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettDong authored and ZhilkinSerg committed Nov 27, 2021
1 parent 2bb3708 commit 698ecfd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/monmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ void monster::plan()
constexpr int max_turns_for_rate_limiting = 1800;
constexpr double max_turns_to_skip = 600.0;
// Outputs a range from 0.0 - 1.0.
int rate_limiting_factor = 1.0 - logarithmic_range( 0, max_turns_for_rate_limiting,
turns_since_target );
float rate_limiting_factor = 1.0 - logarithmic_range( 0, max_turns_for_rate_limiting,
turns_since_target );
int turns_to_skip = max_turns_to_skip * rate_limiting_factor;
if( friendly == 0 && ( turns_to_skip == 0 || turns_since_target % turns_to_skip == 0 ) ) {
for( const auto &fac_list : factions ) {
Expand Down

0 comments on commit 698ecfd

Please sign in to comment.