Fix stalled hunter recovery and document intel cleanup
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -60,6 +60,7 @@ struct UnitType{string Source="hunter";struct GroupType*Group=nullptr;IEntity*En
|
||||
struct AttackType{Vec ReportPosition;float Started=0;bool alive=true,ready=false;bool CoverAlive(){return alive;}bool CoverReady(){return ready;}};
|
||||
struct GunTeam{int ticks=0;void Tick(float){ticks++;}void Pause(){}};
|
||||
struct Tactics{
|
||||
int rejected=0;void RejectStage(float){rejected++;}
|
||||
int m_ApproachRetries=0,m_CoverRetries=0,alternates=0;float m_BlindSince=-1;bool alternateWorks=true;
|
||||
bool AlternateStage(float now){alternates++;if(!alternateWorks)return false;State=1;m_BlindSince=-1;m_ApproachProgress=now;Stage={500,0,-250};return true;}
|
||||
GunTeam*m_GunTeam=nullptr;bool align=false,facing=false;bool TryAlign(){return align;}bool FacingSector(){return facing;}
|
||||
@@ -224,6 +225,7 @@ struct UnitType{struct Entity entity;struct Entity*Entity=&entity;};
|
||||
struct Tactics;struct AttackType{Array<Tactics*>Teams;};
|
||||
float ManeuverBudget(float){return 240000;}
|
||||
struct Tactics{
|
||||
int rejected=0;void RejectStage(float){rejected++;}
|
||||
UnitType unit;UnitType*Unit=&unit;AttackType attack;AttackType*Attack=&attack;
|
||||
Vec Stage{0,0,-210},Approach{155,0,-240},Sector{105,0,35},m_ApproachPosition;
|
||||
Array<Vec>m_RejectedStages,reservations;int State=3;float m_BlindSince=1000,m_ApproachProgress=0,m_ApproachStarted=1000,m_TravelDistance=1000,Deadline=100;
|
||||
@@ -235,7 +237,7 @@ struct Tactics{
|
||||
int main(){
|
||||
for(int failure=0;failure<2;failure++){
|
||||
Tactics t;t.plan=failure!=0;t.move=failure!=1;
|
||||
assert(!t.AlternateStage(21000));assert(t.Stage.x==0&&t.Approach.x==155&&t.State==3&&t.m_RejectedStages.empty());
|
||||
assert(!t.AlternateStage(21000));assert(t.Stage.x==0&&t.Approach.x==155&&t.State==3&&t.m_RejectedStages.empty()&&t.rejected==1);
|
||||
}
|
||||
Tactics t,other,dead;dead.live=false;other.Stage={-200,0,-210};t.attack.Teams={&t,&other,&dead};t.m_RejectedStages.Insert({-100,0,-300});
|
||||
assert(t.AlternateStage(21000));assert(t.reservations.size()==4&&t.reservations.back().x==-200);
|
||||
|
||||
Reference in New Issue
Block a user