[colobot] 40/145: Solves #700

Didier Raboud odyx at moszumanska.debian.org
Mon Jul 11 12:56:15 UTC 2016


This is an automated email from the git hooks/post-receive script.

odyx pushed a commit to branch debian/master
in repository colobot.

commit 1960b373f1a3124053339e2febbc7990ef92cf7f
Author: KarolTrzeszczkowski <karol.trzeszczkowski at gmail.com>
Date:   Sun Apr 3 12:45:50 2016 +0200

    Solves #700
    
    It turns out, that tower is not over powered in code battle mode. It never hits flying enemy robot.
---
 src/object/auto/autotower.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/object/auto/autotower.cpp b/src/object/auto/autotower.cpp
index 23d8f2c..ad436af 100644
--- a/src/object/auto/autotower.cpp
+++ b/src/object/auto/autotower.cpp
@@ -271,12 +271,16 @@ CObject* CAutoTower::SearchTarget(Math::Vector &impact)
     CObject* best = nullptr;
     for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
     {
+        int oTeam=obj->GetTeam();
+        int myTeam=m_object->GetTeam();
         ObjectType oType = obj->GetType();
         if ( oType != OBJECT_MOTHER &&
              oType != OBJECT_ANT    &&
              oType != OBJECT_SPIDER &&
              oType != OBJECT_BEE    &&
-             oType != OBJECT_WORM   )  continue;
+             oType != OBJECT_WORM   &&
+             (oTeam == myTeam        ||
+             oTeam == 0)             )  continue;
 
         if ( !obj->GetDetectable() )  continue;  // inactive?
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git



More information about the Pkg-games-commits mailing list