From b8401bf208d8ae1658bc78d48cbe9e27516cb3fd Mon Sep 17 00:00:00 2001 From: Titus Tscharntke Date: Wed, 30 May 2012 21:53:41 +0000 Subject: [PATCH] Making it a bit random if standing or runnning units are attacked by Ultra/Mega CPUs --- source/glest_game/world/unit_updater.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 43e992f7..027181ef 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -2386,9 +2386,11 @@ bool UnitUpdater::unitOnRange(const Unit *unit, int range, Unit **rangedPtr, } } } + + random.randRange(0, 1); if(unit->getFaction()->getControlType()==ctCpuUltra || unit->getFaction()->getControlType()==ctCpuMega) { - if(attackingEnemySeen!=NULL) { + if( attackingEnemySeen!=NULL && random.randRange(0,2)>0 ) { *rangedPtr = attackingEnemySeen; enemySeen = attackingEnemySeen; //printf("Da hat er wen gefunden:%s\n",enemySeen->getType()->getName(false).c_str());