From 09030724b37b7aee1c55daf5cd26c9fa99440c6b Mon Sep 17 00:00:00 2001 From: Xottab_DUTY Date: Sun, 7 Apr 2019 01:59:31 +0500 Subject: [PATCH] Random crows spawn position Now they won't fly from one point on the ground --- cs/engine/xrGame/ai/crow/ai_crow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cs/engine/xrGame/ai/crow/ai_crow.cpp b/cs/engine/xrGame/ai/crow/ai_crow.cpp index 037dad54a..4e5be7df9 100644 --- a/cs/engine/xrGame/ai/crow/ai_crow.cpp +++ b/cs/engine/xrGame/ai/crow/ai_crow.cpp @@ -151,6 +151,13 @@ BOOL CAI_Crow::net_Spawn (CSE_Abstract* DC) // disable UpdateCL, enable only on HIT processing_deactivate (); VERIFY2( valid_pos( Position() ), dbg_valide_pos_string(Position(),this,"CAI_Crow::net_Spawn") ); + + Fvector tmp = Actor()->Position(); + tmp.x = tmp.x + ::Random.randF(-50.0f, 50.0f); + tmp.y = tmp.y + ::Random.randF(20.0f, 50.0f); + tmp.z = tmp.z + ::Random.randF(-50.0f, 50.0f); + Position().set(tmp); + return R; }