Complete roadblocks in background and fix session regressions
Continue safe roadblock placement after admission and prison unlock, build posts incrementally, and clean up incomplete transactions. Add bounded stuck-patrol dismount recovery, defer deployment initialization during terrain takeover, reset deferred site search timing on first player arrival, and fix atlas page serialization and terrain resource lookup. Validation: 30 native Everon posts with 120 living guards after unlock; seven affected regression suites pass; two final restart smoke rounds complete with 21 assertions and no script/runtime failures. Existing dependency asset errors remain.
This commit is contained in:
@@ -121,6 +121,8 @@ struct string:std::string {
|
||||
void Replace(string a,string b){size_t n=0;while((n=find(a,n))!=npos){replace(n,a.size(),b);n+=b.size();}}
|
||||
string Trim(){auto a=find_first_not_of(" \r\n");if(a==npos)return "";return substr(a,find_last_not_of(" \r\n")-a+1);}
|
||||
string GetPath(){auto n=find('}');return n==npos?*this:string(substr(n+1));}
|
||||
bool IsExternal(){return size()>18&&front()=='{'&&at(17)=='}';}
|
||||
bool IsInternal(){return size()==18&&front()=='{'&&at(17)=='}';}
|
||||
};
|
||||
string StripPath(string s){auto n=s.find_last_of('/');return n==s.npos?s:string(s.substr(n+1));}
|
||||
template<class T>struct Array:std::vector<T>{void Insert(T v){this->push_back(v);}bool Contains(T v){return std::find(this->begin(),this->end(),v)!=this->end();}};
|
||||
@@ -128,16 +130,19 @@ struct Container{string parent;bool Get(string& p){p=parent;return !p.IsEmpty();
|
||||
struct Resource{Container container;bool valid=true;bool IsValid(){return valid;}Resource* GetResource(){return this;}Container* ToBaseContainer(){return &container;}};
|
||||
std::map<string,Resource> resources;int calls=0;
|
||||
Resource* Load(string world){calls++;auto it=resources.find(world);return it==resources.end()?nullptr:&it->second;}
|
||||
string Res(string path){return "{0123456789ABCDEF}"+path;}
|
||||
struct Names {
|
||||
'''+resolver+r'''
|
||||
};
|
||||
int main(){
|
||||
resources["Worlds/GM/Conflict.ent"].container.parent="Worlds/Armenhof/Armenhof.ent";
|
||||
resources["Worlds/Armenhof/Armenhof.ent"];
|
||||
assert(Names::Resolve("Worlds/GM/Conflict.ent")=="Armenhof");
|
||||
resources["Worlds/Nogova/Nogova_Test.ent"].container.parent="Worlds/Nogova/Nogova.ent";
|
||||
resources["Worlds/Nogova/Nogova.ent"];
|
||||
assert(Names::Resolve("Worlds/Nogova/Nogova_Test.ent")=="Nogova");
|
||||
resources[Res("Worlds/GM/Conflict.ent")].container.parent=Res("Worlds/Armenhof/Armenhof.ent");
|
||||
resources[Res("Worlds/Armenhof/Armenhof.ent")];
|
||||
assert(Names::Resolve(Res("Worlds/GM/Conflict.ent"))=="Armenhof");
|
||||
resources[Res("Worlds/Nogova/Nogova_Test.ent")].container.parent=Res("Worlds/Nogova/Nogova.ent");
|
||||
resources[Res("Worlds/Nogova/Nogova.ent")];
|
||||
assert(Names::Resolve(Res("Worlds/Nogova/Nogova_Test.ent"))=="Nogova");
|
||||
calls=0;assert(Names::Resolve("worlds/Eden/Eden.ent")=="Everon"&&calls==0);
|
||||
assert(Names::Resolve("$NogovaReforger:Worlds/Nogova/Nogova.ent")=="Nogova"&&calls==0);
|
||||
assert(Names::Label("{853E92315D1D9EFE}worlds/Eden/Eden.ent")=="Everon");
|
||||
assert(Names::Resolve("Worlds/New_Island.ent")=="New Island");
|
||||
assert(Names::Label("Worlds/GameMaster/GM_Armenhof.ent")=="Armenhof");
|
||||
@@ -150,10 +155,10 @@ int main(){
|
||||
assert(Names::Path("{bad}Worlds/Island.ent")=="{bad}Worlds/Island.ent");
|
||||
assert(Names::Label("$NogovaReforger:Worlds/Nogova/Nogova_Test.ent")=="Nogova");
|
||||
|
||||
resources["a.ent"].container.parent="b.ent";resources["b.ent"].container.parent="a.ent";
|
||||
calls=0;assert(Names::Resolve("a.ent")=="B"&&calls==2);
|
||||
for(int i=0;i<30;i++)resources[std::to_string(i)+".ent"].container.parent=std::to_string(i+1)+".ent";
|
||||
calls=0;assert(Names::Resolve("0.ent")=="16"&&calls==16);
|
||||
resources[Res("a.ent")].container.parent=Res("b.ent");resources[Res("b.ent")].container.parent=Res("a.ent");
|
||||
calls=0;assert(Names::Resolve(Res("a.ent"))=="B"&&calls==2);
|
||||
for(int i=0;i<30;i++)resources[Res(std::to_string(i)+".ent")].container.parent=Res(std::to_string(i+1)+".ent");
|
||||
calls=0;assert(Names::Resolve(Res("0.ent"))=="16"&&calls==16);
|
||||
}
|
||||
''')
|
||||
print('PASS: actual terrain parent traversal, Armenhof/Nogova names, Everon alias, missing-resource fallback, empty names and bounded cycles/depth')
|
||||
|
||||
Reference in New Issue
Block a user