Fix convoy coordination, AI combat and spectator recovery
This commit is contained in:
@@ -21,7 +21,7 @@ int main(){
|
||||
p.Committed(45000);assert(!p.Consider(&s,50000));assert(!p.Consider(&s,525000));assert(p.Consider(&s,570000));
|
||||
s.CommittedFit=6;assert(!p.Consider(&s,600000));s.CommittedFit=0;s.GroundFit=6;assert(!p.Consider(&s,600000));
|
||||
s.ConfirmedLosses=2;assert(!p.Consider(&s,600000));assert(p.Consider(&s,620000));
|
||||
s.ArtilleryBusy=true;assert(!p.Consider(&s,630000));s.ArtilleryBusy=false;assert(!p.Consider(&s,640000));assert(p.Consider(&s,660000));
|
||||
s.ArtilleryBusy=true;assert(!p.Consider(&s,630000));s.ArtilleryBusy=false;assert(p.Consider(&s,640000));assert(p.Consider(&s,660000));
|
||||
s.BeliefId=2;assert(!p.Consider(&s,670000));assert(!p.Consider(&s,689999));assert(p.Consider(&s,690000));
|
||||
auto good=s;
|
||||
s.Age=91;assert(!p.Consider(&s,700000));s=good;s.Confidence=.69;assert(!p.Consider(&s,700000));
|
||||
@@ -30,6 +30,26 @@ int main(){
|
||||
s=good;s.MotionKnown=false;assert(!p.Consider(&s,700000));s=good;s.AircraftReady=false;assert(!p.Consider(&s,700000));
|
||||
s=good;s.Age=std::numeric_limits<float>::quiet_NaN();assert(!p.Consider(&s,700000));
|
||||
assert(!p.Consider(nullptr,700000));assert(!p.Consider(&good,std::numeric_limits<float>::infinity()));
|
||||
// Artillery blocks authorization, not the history of fresh sightings and
|
||||
// ground-force shortage. Repeated <45-second clear windows used to starve
|
||||
// airborne support by restarting its confirmation timer on every salvo.
|
||||
ERR_AirSupportPolicy blocked;auto contact=good;contact.BeliefId=9;contact.GroundFit=0;contact.ConfirmedLosses=0;
|
||||
assert(!blocked.Consider(&contact,0));
|
||||
contact.ArtilleryBusy=true;
|
||||
assert(!blocked.Consider(&contact,10000));
|
||||
assert(!blocked.Consider(&contact,46000));
|
||||
contact.ArtilleryBusy=false;assert(blocked.Consider(&contact,47000));
|
||||
// Stale intelligence and a changed target still invalidate confirmation.
|
||||
contact.Age=91;assert(!blocked.Consider(&contact,48000));
|
||||
contact.Age=5;assert(!blocked.Consider(&contact,49000));
|
||||
contact.BeliefId=10;assert(!blocked.Consider(&contact,90000));
|
||||
assert(!blocked.Consider(&contact,134999));assert(blocked.Consider(&contact,135000));
|
||||
// Busy airspace must not preconfirm a new drop during the 8-minute cooldown.
|
||||
blocked.Committed(135000);contact.ArtilleryBusy=true;
|
||||
assert(!blocked.Consider(&contact,614999));
|
||||
contact.ArtilleryBusy=false;assert(!blocked.Consider(&contact,615000));
|
||||
assert(!blocked.Consider(&contact,659999));assert(blocked.Consider(&contact,660000));
|
||||
|
||||
}
|
||||
''')
|
||||
print('PASS: production airborne memory confidence, persistence, ground coverage, confirmed losses, artillery veto, cooldown and invalid-input rules')
|
||||
|
||||
Reference in New Issue
Block a user