Capture current mission, AI, map and administration development

Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
This commit is contained in:
2026-10-13 22:52:53 +02:00
parent a951a96edc
commit 6a667d8deb
8104 changed files with 2124945 additions and 2061 deletions
+18 -2
View File
@@ -25,10 +25,10 @@ for name in ('ERR_EnemyEquipmentCallback','ERR_EnemyOpticsJob','ERR_EnemyOpticsI
code=code.replace('void ERR_EnemyOptics(','ERR_EnemyOptics(')
code=code.replace('EWeaponType type','int type').replace('foreach (','for (').replace('null','nullptr')
for name in ('ERR_EnemyEquipmentRules','ERR_HQ','Math','EStoragePurpose','EWeaponType'):code=code.replace(name+'.',name+'::')
for name in ('entity','child','weapon','sights','slot','job','manager','inventory','storage','inspection'):
for name in ('entity','child','weapon','sights','slot','job','existing','manager','inventory','storage','inspection'):
code=re.sub(r'\b'+name+r'\.',name+'->',code)
code=code.replace('mode.Content().Allows(prefab)', 'mode->Content()->Allows(prefab)').replace('mode.Content()', 'mode->Content()')
code=code.replace('job->Operation.','job->Operation->')
code=code.replace('job->Operation.','job->Operation->').replace('m_Jobs[before].Checks', 'm_Jobs[before]->Checks')
code=re.sub(r'\b(bool|int|IEntity|SCR_AIGroup) (\w+);',r'\1 \2{};',code)
code=re.sub(r'\b(ERR_EnemyEquipmentCallback\*) (\w+);',r'\1 \2{};',code)
code=code.replace('\n}\n','\n};\n')
@@ -71,6 +71,22 @@ struct Fixture{ERR_GameMode mode;Group group,other;Entity actor,rifle;Weapon wea
int main(){
{Fixture f;f.mode.content.rhs=false;f.inv.fit=false;ERR_EnemyOptics s(&f.actor,&f.group);for(int i=0;i<5;i++)s.Check(&f.mode);assert(f.inv.submits==0&&f.inv.checks==12);}
// A confirmed automatic grant after startup gets its own bounded attempt window.
{Fixture f;f.inv.fit=false;ERR_EnemyOptics s(&f.actor,&f.group);
for(int i=0;i<5;i++)s.Check(&f.mode);
Entity issued;Weapon weapon;Storage storage;Slot slot;
issued.weapon=&weapon;issued.storage=&storage;weapon.owner=&issued;storage.slots={&slot};
f.manager.weapons.Insert(&issued);f.inv.fit=true;
s.Check(&f.mode);assert(f.inv.submits==0); // Later roster entries are not implicitly granted scopes.
s.RegisterIssuedWeapon(&issued);s.RegisterIssuedWeapon(&issued);
assert(s.m_Jobs.Count()==2);s.Check(&f.mode);assert(f.inv.submits==1);
for(int i=0;i<10;i++)s.Check(&f.mode);
assert(f.inv.submits==1&&s.m_Jobs[1]->Checks==5);
s.RegisterIssuedWeapon(&issued);s.Check(&f.mode);assert(f.inv.submits==1);
s.Stop();Entity other;s.RegisterIssuedWeapon(&other);assert(s.m_Jobs.Count()==2);}
// A registered gun must still belong to the exact actor; never equip a dropped grant.
{Fixture f;ERR_EnemyOptics s(&f.actor,&f.group);s.RegisterIssuedWeapon(&f.rifle);
f.manager.weapons.clear();assert(s.Check(&f.mode));assert(f.inv.submits==0);}
// Existing mounted/nested/sights magnified optics are preserved. Occupied red dots aren't overwritten.
for(int style=0;style<3;style++){Fixture f;Entity optic,adapter;Sights sights;Slot attach;
optic.scope2D=style==0;optic.scope2DPip=style==1;optic.scopePip=style==2;if(style==0){f.rifle.child=&adapter;adapter.child=&optic;}