From 09c9e16cb122f2939f60be7565712324897bd5f9 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sat, 30 May 2020 20:08:31 +0300 Subject: roadblocks --- src/control/PathFind.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/control/PathFind.h') diff --git a/src/control/PathFind.h b/src/control/PathFind.h index 7abc455a..171a79c5 100644 --- a/src/control/PathFind.h +++ b/src/control/PathFind.h @@ -5,6 +5,8 @@ class CVehicle; class CPtrList; +#define LANE_WIDTH 5.0f + enum { NodeTypeExtern = 1, @@ -85,6 +87,8 @@ struct CPathNode float GetX(void) { return x/8.0f; } float GetY(void) { return y/8.0f; } float GetZ(void) { return z/8.0f; } + bool HasDivider(void) { return width != 0; } + float GetDivider(void) { return width/(2*8.0f); } CPathNode *GetPrev(void); CPathNode *GetNext(void); void SetPrev(CPathNode *node); @@ -120,7 +124,7 @@ struct CCarPathLink float GetY(void) { return y/8.0f; } float GetDirX(void) { return dirX/100.0f; } float GetDirY(void) { return dirY/100.0f; } - float GetLaneOffset(void) { return width/80.0f; } + float GetLaneOffset(void) { return width/(2*8.0f*LANE_WIDTH); } float OneWayLaneOffset() { -- cgit v1.2.3 From 49a897c3b3371ed59ea314a0359f3ed989f191e9 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sat, 30 May 2020 20:09:58 +0300 Subject: better name --- src/control/PathFind.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/control/PathFind.h') diff --git a/src/control/PathFind.h b/src/control/PathFind.h index 171a79c5..e481f4c6 100644 --- a/src/control/PathFind.h +++ b/src/control/PathFind.h @@ -88,7 +88,7 @@ struct CPathNode float GetY(void) { return y/8.0f; } float GetZ(void) { return z/8.0f; } bool HasDivider(void) { return width != 0; } - float GetDivider(void) { return width/(2*8.0f); } + float GetDividerWidth(void) { return width/(2*8.0f); } CPathNode *GetPrev(void); CPathNode *GetNext(void); void SetPrev(CPathNode *node); -- cgit v1.2.3