Skip to content

Commit

Permalink
Random bit of wander code isn't unbiased (#72793)
Browse files Browse the repository at this point in the history
* Hopefully fix zeds without stimulus in packs moving in one direction

* Update monmove.cpp
  • Loading branch information
Procyonae authored Apr 2, 2024
1 parent 10801ce commit 0e3ed4b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/monmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,10 @@ void monster::plan()
}
if( mon_plan.swarms ) {
if( rating < 5 ) { // Too crowded here
wander_pos = get_location() + point( rng( 1, 3 ), rng( 1, 3 ) );
wander_pos = get_location();
while( wander_pos == get_location() ) {
wander_pos += point( rng( -3, 3 ), rng( -3, 3 ) );
}
wandf = 2;
mon_plan.target = nullptr;
// Swarm to the furthest ally you can see
Expand Down

0 comments on commit 0e3ed4b

Please sign in to comment.