Fixed crashes in HRP code

Reverted the version string on the main menu.
This commit is contained in:
NovaRain
2021-12-20 12:16:18 +08:00
parent 3cc98fc15d
commit 680284d785
4 changed files with 12 additions and 9 deletions
+4 -3
View File
@@ -220,7 +220,7 @@ static __inline long DistanceFromPositions(long sX, long sY, long tX, long tY) {
}
// optimized version with added args
// type: 1 - tile path, 0 - rotation path
// type: 0 - rotation path, 1 - tile path
// maxNodes: limiting the building of a path
long __fastcall Tilemap::make_path_func(fo::GameObject* srcObject, long sourceTile, long targetTile, long type, long maxNodes, void* arrayRef, long checkTargetTile, void* blockFunc) {
if (checkTargetTile && fo::func::obj_blocking_at_wrapper(srcObject, targetTile, srcObject->elevation, blockFunc)) return 0;
@@ -256,7 +256,7 @@ long __fastcall Tilemap::make_path_func(fo::GameObject* srcObject, long sourceTi
// Tweak for NumPathNodes option
if (maxNodes > 10000 && srcObject != fo::var::obj_dude && maxNodes == maxPathNodes) {
maxNodes = 10000; // limit for NPCs (maybe need less)
maxNodes = 10000; // limit for NPCs
}
// search path tiles
@@ -357,7 +357,8 @@ long __fastcall Tilemap::make_path_func(fo::GameObject* srcObject, long sourceTi
*arrayR++ = childData.rotation;
}
}
while (childData.from_tile != dadData->tile) --dadData; // search a linked tile 'from -> tile'
// search a linked tile 'from -> tile'
while (dadData->from_tile != -1 && childData.from_tile != dadData->tile) --dadData;
childData = *dadData;
} while (++pathLen < 800);
+1
View File
@@ -197,6 +197,7 @@ static fo::DbFile* LoadMapEdgeFileSub(char* mapName) {
if (getValue != mapLevel) break; // next level
EdgeBorder::Edge *edge = new EdgeBorder::Edge;
edge->clipData = 0;
edge->prevEdgeData = edgeData;
edge->nextEdgeData = nullptr;
edge->squareRect = edgeData->squareRect; // rect copy
+5 -4
View File
@@ -17,10 +17,10 @@ public:
RECT borderRect; // right is less than left
RECT rect_2;
RECT tileRect;
RECT squareRect; // angel clipping
long clipData; // angel clip type
Edge* prevEdgeData; // unused (used in 3.06)
Edge* nextEdgeData;
RECT squareRect; // angel clipping
long clipData; // angel clip type
Edge* prevEdgeData = nullptr; // unused (used in 3.06)
Edge* nextEdgeData = nullptr;
void Release() {
Edge* edge = nextEdgeData;
@@ -28,6 +28,7 @@ public:
Edge* edgeNext = edge->nextEdgeData;
delete edge;
edge = edgeNext;
nextEdgeData = nullptr;
};
}
+2 -2
View File
@@ -28,9 +28,9 @@ namespace sfall
{
#ifdef NDEBUG
static const char* VerString1 = "SFALL w/ HRP " VERSION_STRING;
static const char* VerString1 = "SFALL " VERSION_STRING;
#else
static const char* VerString1 = "SFALL w/ HRP " VERSION_STRING " Debug Build";
static const char* VerString1 = "SFALL " VERSION_STRING " Debug Build";
#endif
long MainMenu::mXOffset;