You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -214,16 +214,17 @@ static __forceinline fo::GameObject* CheckTileBlocking(void* blockFunc, long til
214
214
//return object;
215
215
}
216
216
217
-
// idist_
217
+
//same as idist_
218
218
static __inline longDistanceFromPositions(longsX, longsY, long tX, long tY) {
219
219
long diffX = std::abs(tX - sX);
220
220
long diffY = std::abs(tY - sY);
221
221
long minDiff = (diffX <= diffY) ? diffX : diffY;
222
222
return (diffX + diffY) - (minDiff >> 1);
223
223
}
224
224
225
-
// optimized version
226
-
long __fastcall Tilemap::make_path_func(fo::GameObject* srcObject, long sourceTile, long targetTile, uint8_t* arrayRotation, long checkTargetTile, void* blockFunc) {
225
+
// optimized version with added 'type' arg
226
+
// type: 1 - tile path, 0 - rotation path
227
+
long __fastcall Tilemap::make_path_func(fo::GameObject* srcObject, long sourceTile, long targetTile, long type, void* arrayRef, long checkTargetTile, void* blockFunc) {
227
228
228
229
if (checkTargetTile && fo::func::obj_blocking_at_wrapper(srcObject, targetTile, srcObject->elevation, blockFunc)) return0;
229
230
@@ -281,7 +282,9 @@ long __fastcall Tilemap::make_path_func(fo::GameObject* srcObject, long sourceTi
281
282
if (childData.tile == targetTile) break; // exit the loop path is built
282
283
283
284
*dadData = childData;
284
-
if (++dadData == m_dadData.end()) return0; // path can't be built reached the end of the array (limit the maximum path length)
285
+
if (++dadData == m_dadData.end()) {
286
+
return0; // path can't be built reached the end of the array (limit the maximum path length)
287
+
}
285
288
286
289
char rotation = 0;
287
290
do {
@@ -295,17 +298,16 @@ long __fastcall Tilemap::make_path_func(fo::GameObject* srcObject, long sourceTi
Copy file name to clipboardExpand all lines: sfall/Game/tilemap.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ class Tilemap {
17
17
18
18
staticlong __fastcall tile_num_beyond(long sourceTile, long targetTile, long maxRange);
19
19
20
-
staticlong __fastcall make_path_func(fo::GameObject* srcObject, long sourceTile, long targetTile, uint8_t* arrayRotation, long checkTargetTile, void* blockFunc);
20
+
staticlong __fastcall make_path_func(fo::GameObject* srcObject, long sourceTile, long targetTile, long type, void* arrayRef, long checkTargetTile, void* blockFunc);
0 commit comments