forked from illiath/EnhancedFlightMap
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathKnownPaths.lua
36 lines (29 loc) · 824 Bytes
/
KnownPaths.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--[[
KnownPaths.lua
This segment deals with who knows what flight path.
]]
-- Function: Record that the player knows this flight master.
function EFM_KP_AddLocation(myContinent, myNode)
if (EFM_KnownNodes == nil) then
EFM_KnownNodes = {};
end
if (EFM_KnownNodes[myContinent] == nil) then
EFM_KnownNodes[myContinent] = {};
end
if (not EFM_KP_CheckPaths(myContinent, myNode)) then
table.insert(EFM_KnownNodes[myContinent], myNode);
end
end
-- Function: Check if player knows the flight path, return true if known, false otherwise.
function EFM_KP_CheckPaths(myContinent, myNode)
if (EFM_KnownNodes ~= nil) then
if (EFM_KnownNodes[myContinent] ~= nil) then
for key, val in pairs(EFM_KnownNodes[myContinent]) do
if (val == myNode) then
return true;
end
end
end
end
return false;
end