From 0e3ed4b70ca74024a917df0f5512de5bc537a495 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Tue, 2 Apr 2024 21:56:53 +0100 Subject: [PATCH] Random bit of wander code isn't unbiased (#72793) * Hopefully fix zeds without stimulus in packs moving in one direction * Update monmove.cpp --- src/monmove.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/monmove.cpp b/src/monmove.cpp index e10d084e0468c..a2161d2140201 100644 --- a/src/monmove.cpp +++ b/src/monmove.cpp @@ -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