Add configurable nearby garage vehicles and fix roadblocks and fuel pumps; record Workshop 0.0.131
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -14,7 +14,7 @@ def tr(s):
|
||||
s=re.sub(r'\b'+t+r' (\w+)',t+r'* \1',s)
|
||||
for n in ('m_Mode','mode','hq','unit','Group','agent','record','Recovery','Tactics','CloseContact','entity'):
|
||||
s=re.sub(r'\b'+n+r'\.',n+'->',s)
|
||||
s=s.replace('Forces().','Forces()->').replace('Players().','Players()->').replace('Command().','Command()->').replace('Hunters().','Hunters()->').replace('CivilianTraffic().','CivilianTraffic()->')
|
||||
s=s.replace('Forces().','Forces()->').replace('Players().','Players()->').replace('Command().','Command()->').replace('Hunters().','Hunters()->').replace('CivilianTraffic().','CivilianTraffic()->').replace('GarageVehicles().','GarageVehicles()->')
|
||||
for n in ('Replication','ERR_GameMode','ERR_ConvoyRules','SCR_EntityHelper'):s=s.replace(n+'.',n+'::')
|
||||
s=s.replace('ERR_HQ* hq;','ERR_HQ* hq=nullptr;').replace('int depth;','int depth=0;')
|
||||
return s
|
||||
@@ -34,8 +34,8 @@ struct BaseCompartmentManagerComponent{};
|
||||
struct Service;struct ERR_HQ;
|
||||
struct Roster{IEntity*current=nullptr;void*CurrentActor(IEntity*a){return a&&a==current?this:nullptr;}};
|
||||
struct ERR_ForceRecord{bool Pinned=true;};struct Ledger{ERR_ForceRecord r;ERR_ForceRecord*FindGroup(GroupType*){return &r;}};
|
||||
struct Traffic{void PlayerEntered(IEntity*,IEntity*){}};
|
||||
struct ERR_GameMode{Traffic* CivilianTraffic(){return nullptr;}inline static ERR_GameMode*current=nullptr;bool active=true;ERR_HQ*command=nullptr;Roster roster;Ledger ledger;static ERR_GameMode*Get(){return current;}bool Active(){return active;}ERR_HQ*Command(){return command;}Roster*Players(){return &roster;}Ledger*Forces(){return &ledger;}};
|
||||
struct Traffic{int calls=0;IEntity* actor=nullptr;IEntity* target=nullptr;void PlayerEntered(IEntity* a,IEntity* t){calls++;actor=a;target=t;}};
|
||||
struct ERR_GameMode{Traffic garage;Traffic* GarageVehicles(){return &garage;}Traffic* CivilianTraffic(){return nullptr;}inline static ERR_GameMode*current=nullptr;bool active=true;ERR_HQ*command=nullptr;Roster roster;Ledger ledger;static ERR_GameMode*Get(){return current;}bool Active(){return active;}ERR_HQ*Command(){return command;}Roster*Players(){return &roster;}Ledger*Forces(){return &ledger;}};
|
||||
namespace Replication{bool server=true;bool IsServer(){return server;}}
|
||||
namespace ERR_ConvoyRules{bool occupied=false;bool Captured(IEntity*,GroupType*){return occupied;}
|
||||
'''+part+r'''
|
||||
@@ -65,6 +65,7 @@ int main(){
|
||||
// Native occupancy is not visible yet; super removes current identity to model
|
||||
// disconnect/body loss before next one-second poll. Event must win that gap.
|
||||
c.Enter();assert(c.unit.PlayerCaptureObserved&&c.unit.Released);assert(c.access.nativeCalls==1);
|
||||
assert(c.mode.garage.calls==1&&c.mode.garage.actor==&c.player&&c.mode.garage.target==&c.turret);
|
||||
assert(c.hq.unregistered==1&&c.hq.retained==0&&c.hq.recoveries==0);
|
||||
assert(c.close.stops==1&&c.recovery.stops==1&&c.unit.Downlink==nullptr&&c.unit.orders==0&&c.unit.clears==1);
|
||||
assert(!c.mode.ledger.r.Pinned&&c.unit.Entity==&c.vehicle&&c.unit.Group==&c.group);
|
||||
|
||||
Reference in New Issue
Block a user