Skip to content

Commit

Permalink
refactor: derive default coral rather than explicitly set it in Config
Browse files Browse the repository at this point in the history
  • Loading branch information
Manason authored Nov 7, 2023
1 parent 8747b77 commit 64b980b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Config.CoralLocations = {
},
}
},
DefaultCoral = 4,
TotalCoral = 4,
},
{
Expand Down Expand Up @@ -69,7 +68,6 @@ Config.CoralLocations = {
},
}
},
DefaultCoral = 3,
TotalCoral = 3,
},
{
Expand Down Expand Up @@ -100,7 +98,6 @@ Config.CoralLocations = {
},
}
},
DefaultCoral = 3,
TotalCoral = 3,
},
{
Expand Down Expand Up @@ -131,7 +128,6 @@ Config.CoralLocations = {
},
}
},
DefaultCoral = 3,
TotalCoral = 3,
},
{
Expand Down Expand Up @@ -169,7 +165,6 @@ Config.CoralLocations = {
},
}
},
DefaultCoral = 4,
TotalCoral = 4,
},
{
Expand Down Expand Up @@ -207,7 +202,6 @@ Config.CoralLocations = {
},
}
},
DefaultCoral = 4,
TotalCoral = 4,
},
{
Expand Down Expand Up @@ -245,7 +239,6 @@ Config.CoralLocations = {
},
}
},
DefaultCoral = 4,
TotalCoral = 4,
},
}
Expand Down
2 changes: 1 addition & 1 deletion server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ RegisterNetEvent('qb-diving:server:TakeCoral', function(area, coral, bool)
for _, v in pairs(Config.CoralLocations[currentDivingArea].coords.Coral) do
v.PickedUp = false
end
Config.CoralLocations[currentDivingArea].TotalCoral = Config.CoralLocations[currentDivingArea].DefaultCoral
Config.CoralLocations[currentDivingArea].TotalCoral = #Config.CoralLocations[currentDivingArea].coords.Coral
local newLocation = math.random(1, #Config.CoralLocations)
while newLocation == currentDivingArea do
newLocation = math.random(1, #Config.CoralLocations)
Expand Down

0 comments on commit 64b980b

Please sign in to comment.