mirror of
https://github.com/diasurgical/devilution.git
synced 2026-06-20 05:46:12 +00:00
Clean up path.cpp
This commit is contained in:
committed by
Dennis Duda
parent
b1b80c957a
commit
4e2ea5d312
+12
-11
@@ -119,10 +119,10 @@ int __fastcall FindPath(BOOL (__fastcall *PosOk)(int, int, int), int PosOkArg, i
|
||||
/* heuristic, estimated cost from (sx,sy) to (dx,dy) */
|
||||
int __fastcall path_get_h_cost(int sx, int sy, int dx, int dy)
|
||||
{
|
||||
int y; // esi
|
||||
int delta_x; // edi
|
||||
int delta_y; // eax
|
||||
int min_delta; // ecx
|
||||
int y;
|
||||
int delta_x;
|
||||
int delta_y;
|
||||
int min_delta;
|
||||
|
||||
y = sy;
|
||||
delta_x = abs(sx - dx);
|
||||
@@ -147,7 +147,7 @@ int __fastcall path_get_h_cost(int sx, int sy, int dx, int dy)
|
||||
*/
|
||||
int __fastcall path_check_equal(PATHNODE *pPath, int dx, int dy)
|
||||
{
|
||||
int result; // [esp-4h] [ebp-4h]
|
||||
int result;
|
||||
|
||||
if ( pPath->x == dx || pPath->y == dy )
|
||||
result = 2;
|
||||
@@ -161,15 +161,16 @@ int __fastcall path_check_equal(PATHNODE *pPath, int dx, int dy)
|
||||
*/
|
||||
PATHNODE *__cdecl GetNextPath()
|
||||
{
|
||||
PATHNODE *result; // eax
|
||||
PATHNODE *result;
|
||||
|
||||
result = path_2_nodes->NextNode;
|
||||
if ( result )
|
||||
{
|
||||
path_2_nodes->NextNode = result->NextNode;
|
||||
result->NextNode = pnode_ptr->NextNode;
|
||||
pnode_ptr->NextNode = result;
|
||||
if ( !result ) {
|
||||
return result;
|
||||
}
|
||||
|
||||
path_2_nodes->NextNode = result->NextNode;
|
||||
result->NextNode = pnode_ptr->NextNode;
|
||||
pnode_ptr->NextNode = result;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user