fixed level loading, nav optimization
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "cppGI.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
#include "Misc/paths.h"
|
||||
#include "Engine/levelstreamingdynamic.h"
|
||||
|
||||
/*for working tarray::Contains*/
|
||||
@@ -32,20 +33,28 @@ void UcppGI::cppLvlManage(UObject* WorldContextObject, Fcppcoords currentCoords,
|
||||
}
|
||||
|
||||
cpplvlsForLoading.AddUnique(currentCoords);
|
||||
for (auto& lvl : cpplevelLIst) {
|
||||
for (FcppLevelStruct& lvl : cpplevelLIst) {
|
||||
FString tt = lvl.path;
|
||||
if (currentCoords.floor == 100);
|
||||
else {
|
||||
loadthis = false;
|
||||
for (auto& lvl1 : cpplvlsForLoading) {
|
||||
bool ceq[6];
|
||||
/*cppCoordEq(lvl1,lvl,ceq[0],ceq[1],ceq[2],ceq[3],ceq[4],ceq[5],false,true)*/
|
||||
if (((lvl.coords.flat == -1) || ceq[0] || ((lvl1.flat == lvl.anotherLvl) && (lvl.anotherLvl >= 0)))
|
||||
&& ceq[1]
|
||||
for (Fcppcoords& lvl1 : cpplvlsForLoading) {
|
||||
bool ceq[7];
|
||||
cppCoordsEq(lvl1, lvl.coords,true,false, ceq[0], ceq[1], ceq[2], ceq[3], ceq[4], ceq[5], ceq[6]);
|
||||
if (
|
||||
(
|
||||
(lvl.coords.flat == -1) || ceq[0] ||
|
||||
((lvl1.flat == lvl.anotherLvl) && (lvl.anotherLvl >= 0))
|
||||
)
|
||||
&& ceq[2]
|
||||
&& ceq[3]
|
||||
&& (ceq[4] || ((lvl1.flat == lvl.anotherLvl) && (lvl.anotherLvl >= 0) && (currentState == 11/*3d tour*/)) || ((lvl1.flat == lvl.anotherLvl) && (lvl.anotherLvl >= 0) && ((currentState == 9) || (currentState == 10)/*sel or view plan*/) && (lvl1.flat > lvl.coords.flat)))) loadthis = true;
|
||||
&& ceq[4]
|
||||
&& (ceq[5] || ((lvl1.flat == lvl.anotherLvl) && (lvl.anotherLvl >= 0) && (currentState == 11/*3d tour*/)) ||
|
||||
((lvl1.flat == lvl.anotherLvl) && (lvl.anotherLvl >= 0) && ((currentState == 9) || (currentState == 10)/*sel or view plan*/) && (lvl1.flat > lvl.coords.flat))
|
||||
)
|
||||
) loadthis = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
TArray<FString> blya;
|
||||
blya.Add(FString::FromInt(lvl.coords.flat));
|
||||
blya.Add(FString::FromInt(lvl.coords.zone));
|
||||
@@ -53,10 +62,7 @@ void UcppGI::cppLvlManage(UObject* WorldContextObject, Fcppcoords currentCoords,
|
||||
blya.Add(FString::FromInt(lvl.coords.section));
|
||||
blya.Add(FString::FromInt(lvl.coords.floor));
|
||||
FString instanceStr = FString::Join(blya, L"_");
|
||||
FString temp2;
|
||||
FString* temp3=&temp2;
|
||||
lvl.path.Split(FString(L"."), nullptr, temp3);
|
||||
instanceStr.Append(L"_").Append(*temp3);
|
||||
instanceStr.Append(L"_").Append(FPaths::GetCleanFilename(lvl.path));
|
||||
FName instanceName = FName(instanceStr);
|
||||
|
||||
if (loadthis) {
|
||||
@@ -82,7 +88,7 @@ void UcppGI::cppLvlManage(UObject* WorldContextObject, Fcppcoords currentCoords,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cpplvlsForLoading.Empty();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user