From 1b65d9ef6b9a5d8eb6aa241ed9693b7e6e74f910 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Thu, 18 Apr 2002 00:16:05 +0000 Subject: [PATCH] fixed an evil bug in the emp code --- bs/fleet.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bs/fleet.cpp b/bs/fleet.cpp index 1cdc04f..a15fba3 100644 --- a/bs/fleet.cpp +++ b/bs/fleet.cpp @@ -374,7 +374,8 @@ void Fleet::takeShoot(std::string unittype, int number, std::mapfirst].size() == 0) continue; - if (m_Fleet[j->first].size() == 1) + + if (m_Fleet[j->first].size() == 1 ) m_Fleet[j->first].push_back(m_Fleet[j->first][0]); //cerr << "Target is class: " << j->second.type() << endl; @@ -478,6 +479,9 @@ void Fleet::takeEMP(std::string unittype, int number) if (j->second.type() == "PDS") continue; + if (freeFleet(j->first, 1) <= 0) + continue; + if (m_Fleet[j->first].size() == 0) continue; @@ -514,7 +518,7 @@ void Fleet::takeEMP(std::string unittype, int number) while (k > 0) { - if (*(j->second) <= 0) + if (*(j->second) <= blockedFleet(j->first, 1)) break; int eres = s_Units[j->first].EMP(); -- 2.39.2