Smooth convoy startup and record Workshop 0.0.153
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-11-10 15:34:24 +01:00
parent d8352136e8
commit 2390f77554
72 changed files with 15088 additions and 161 deletions
+3 -3
View File
@@ -24,7 +24,7 @@ run(r'''
#include <vector>
#include <string>
using string=std::string;struct vector{};
template<class T>struct Array:std::vector<T>{using std::vector<T>::vector;void Insert(T v){this->push_back(v);}int Count(){return this->size();}};
template<class T>struct Array:std::vector<T>{using std::vector<T>::vector;void Insert(T v){this->push_back(v);}int Count(){return this->size();}bool IsEmpty(){return this->empty();}};
struct Faction{string key="USSR";string GetFactionKey(){return key;}};Faction enemy;
struct IEntity{virtual ~IEntity()=default;};
struct FactionAffiliationComponent{void SetAffiliatedFaction(Faction*){}};
@@ -72,7 +72,7 @@ int main(){
''')
# Execute the seat-selection and creation body. Failed capacity cannot shrink
# the plan, and every native successful character is immediately owned.
fill=body(path,'protected bool FillCrew(').replace('protected ','')
fill='\n'.join(body(path,method) for method in ('protected bool SelectCrewSeats(', 'protected bool SpawnCrewMember(', 'protected bool FillCrew(')).replace('protected ','')
fill=re.sub(r'//[^\n]*','',fill).replace('array<BaseCompartmentSlot>','Array<BaseCompartmentSlot*>')
for cls in ['ERR_ConvoyVehicle','BaseCompartmentSlot','AIGroup','IEntity']:
fill=re.sub(r'\b'+cls+r' ([A-Za-z_]\w*)',cls+r'* \1',fill)
@@ -85,7 +85,7 @@ run(r'''
#include <cassert>
#include <vector>
using ResourceName=int;
template<class T>struct Array:std::vector<T>{using std::vector<T>::vector;void Insert(T v){this->push_back(v);}int Count(){return this->size();}};
template<class T>struct Array:std::vector<T>{using std::vector<T>::vector;void Insert(T v){this->push_back(v);}int Count(){return this->size();}bool IsEmpty(){return this->empty();}};
enum class ECompartmentType{PILOT,TURRET,CARGO};struct IEntity{};struct AIGroup{};
struct BaseCompartmentSlot{ECompartmentType type;bool occupied=false,accessible=true,fail=false;int spawns=0;ECompartmentType GetType(){return type;}bool IsCompartmentAccessible(){return accessible;}bool IsOccupied(){return occupied;}IEntity* SpawnCharacterInCompartment(ResourceName,AIGroup*&,ResourceName){spawns++;return fail?nullptr:new IEntity();}};
struct Vehicle{Array<BaseCompartmentSlot*>seats;};