Skip to content

Commit

Permalink
major refactoring, 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristo Isberg committed Dec 25, 2018
1 parent fac375a commit 1848ec2
Show file tree
Hide file tree
Showing 15 changed files with 308 additions and 97 deletions.
5 changes: 5 additions & 0 deletions GPS.inc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ enum _:GPS_ERROR {
native bool:IsValidMapNode(MapNode:nodeid);
native GetMapNodePos(MapNode:nodeid, &Float:x, &Float:y, &Float:z);
native GetDistanceBetweenMapNodes(MapNode:first, MapNode:second, &Float:distance);
native GetAngleBetweenMapNodes(MapNode:first, MapNode:second, &Float:angle);
native GetMapNodeDistanceFromPoint(MapNode:nodeid, Float:x, Float:y, Float:z, &Float:distance);
native GetMapNodeAngleFromPoint(MapNode:nodeid, Float:x, Float:y, &Float:angle);
native GetClosestMapNodeToPoint(Float:x, Float:y, Float:z, &MapNode:nodeid, MapNode:ignorednode = INVALID_MAP_NODE_ID);
native GetMapNodeConnectionCount(MapNode:nodeid, &count);
native GetHighestMapNodeID();
native GetRandomMapNode(&MapNode:nodeid);


native FindPath(MapNode:start, MapNode:target, &Path:pathid);
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,4 @@ sampctl package run
* kvann - Creator of the plugin.
* Gamer_Z - Creator of the original RouteConnector plugin which helped me understand the structure of GPS.dat and influenced this plugin a lot. Also the author of the original GPS.dat?
* NaS - Author of the fixed GPS.dat distributed with the plugin.
* Southclaws, IllidanS4, Yashas, J0sh, Johnson_boy/lassir - Helped me with the plugin in some way or another.
* Southclaws, IllidanS4 - Helped me with the plugin in major ways (there were other helpful people as well, I appreciate it all).
5 changes: 0 additions & 5 deletions pawn.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
"dev_dependencies": [
"IllidanS4/PawnPlus"
],
"runtime": {
"plugins": [
"kristoisberg/samp-gps-plugin"
]
},
"resources": [
{
"name": "GPS-windows.zip",
Expand Down
3 changes: 3 additions & 0 deletions samp-gps-plugin.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
<ClCompile Include="src\callback.cpp" />
<ClCompile Include="src\main.cpp" />
<ClCompile Include="src\natives.cpp" />
<ClCompile Include="src\node.cpp" />
<ClCompile Include="src\pathfinder.cpp" />
</ItemGroup>
<ItemGroup>
Expand All @@ -153,7 +154,9 @@
<ClInclude Include="src\amx.h" />
<ClInclude Include="src\callback.h" />
<ClInclude Include="src\common.h" />
<ClInclude Include="src\connection.h" />
<ClInclude Include="src\natives.h" />
<ClInclude Include="src\node.h" />
<ClInclude Include="src\pathfinder.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
9 changes: 9 additions & 0 deletions samp-gps-plugin.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
<ClCompile Include="lib\sdk\amx\getch.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\node.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="gps.inc">
Expand Down Expand Up @@ -76,5 +79,11 @@
<ClInclude Include="lib\sdk\amx\sclinux.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\connection.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\node.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
3 changes: 1 addition & 2 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ typedef void (*logprintf_t)(const char* format, ...);
extern logprintf_t logprintf;
extern void *pAMXFunctions;


struct Path;
struct Connection;
9 changes: 9 additions & 0 deletions src/connection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once

#include "node.h"


struct Connection {
Node* target;
float distance = 0.0f;
};
10 changes: 5 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ AMX_NATIVE_INFO PluginNatives[] = {
{"IsValidMapNode", Natives::IsValidMapNode},
{"GetMapNodePos", Natives::GetMapNodePos},
{"GetDistanceBetweenMapNodes", Natives::GetDistanceBetweenMapNodes},
//{"GetAngleBetweenMapNodes", Natives::GetAngleBetweenMapNodes},
{"GetAngleBetweenMapNodes", Natives::GetAngleBetweenMapNodes},
{"GetMapNodeDistanceFromPoint", Natives::GetMapNodeDistanceFromPoint},
//{"GetMapNodeAngleFromPoint", Natives::GetMapNodeAngleFromPoint},
{"GetMapNodeAngleFromPoint", Natives::GetMapNodeAngleFromPoint},
{"GetClosestMapNodeToPoint", Natives::GetClosestMapNodeToPoint},
//{"GetMapNodeConnectionCount", Natives::GetMapNodeConnectionCount},
//{"GetHighestMapNodeID", Natives::GetHighestMapNodeID},
//{"GetRandomMapNode", Natives::GetRandomMapNode},
{"GetMapNodeConnectionCount", Natives::GetMapNodeConnectionCount},
{"GetHighestMapNodeID", Natives::GetHighestMapNodeID},
{"GetRandomMapNode", Natives::GetRandomMapNode},

{"FindPath", Natives::FindPath},
{"FindPathThreaded", Natives::FindPathThreaded},
Expand Down
Loading

0 comments on commit 1848ec2

Please sign in to comment.