Skip to content

Commit

Permalink
fix(style): indentation and whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
mafewtm authored Oct 22, 2024
1 parent 6c5cf05 commit 48cbc6b
Show file tree
Hide file tree
Showing 11 changed files with 703 additions and 703 deletions.
4 changes: 2 additions & 2 deletions client/main.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
QBX = {}

---@diagnostic disable-next-line: missing-fields
---@diagnostic disable-next-line: missing-fields
QBX.PlayerData = {}
QBX.Shared = require 'shared.main'
QBX.IsLoggedIn = false
Expand Down Expand Up @@ -64,7 +64,7 @@ CreateThread(function()
lib.print.warn('Could not find gameName value in vehicles.meta for vehicle model %s', v.model)
end
end
end
end
end)

lib.callback.register('qbx_core:client:getVehicleClasses', function()
Expand Down
16 changes: 8 additions & 8 deletions modules/hooks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ exports('registerHook', function(event, cb)
eventHooks[event] = {}
end

local mt = getmetatable(cb)
mt.__index = nil
mt.__newindex = nil
local mt = getmetatable(cb)
mt.__index = nil
mt.__newindex = nil
cb.resource = GetInvokingResource()
hookId += 1
cb.hookId = hookId
hookId += 1
cb.hookId = hookId

eventHooks[event][#eventHooks[event] + 1] = cb
return hookId
return hookId
end)

local function removeResourceHooks(resource, id)
for _, hooks in pairs(eventHooks) do
for i = #hooks, 1, -1 do
local hook = hooks[i]
local hook = hooks[i]

if hook.resource == resource and (not id or hook.hookId == id) then
table.remove(hooks, i)
Expand All @@ -67,7 +67,7 @@ AddEventHandler('onResourceStop', removeResourceHooks)
---Remove a previously registered hook by its id
---@param id number hookId
exports('removeHooks', function(id)
removeResourceHooks(GetInvokingResource() or cache.resource, id)
removeResourceHooks(GetInvokingResource() or cache.resource, id)
end)

return triggerEventHooks
2 changes: 1 addition & 1 deletion modules/lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ else
end

if returnSoundId then
return soundId
return soundId
end

ReleaseSoundId(soundId)
Expand Down
6 changes: 3 additions & 3 deletions server/events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -210,17 +210,17 @@ local function playerStateBagCheck(bagName, meta, value)
player.Functions.SetMetaData(meta, value)
end

---@diagnostic disable-next-line: param-type-mismatch
---@diagnostic disable-next-line: param-type-mismatch
AddStateBagChangeHandler('hunger', nil, function(bagName, _, value)
playerStateBagCheck(bagName, 'hunger', value)
end)

---@diagnostic disable-next-line: param-type-mismatch
---@diagnostic disable-next-line: param-type-mismatch
AddStateBagChangeHandler('thirst', nil, function(bagName, _, value)
playerStateBagCheck(bagName, 'thirst', value)
end)

---@diagnostic disable-next-line: param-type-mismatch
---@diagnostic disable-next-line: param-type-mismatch
AddStateBagChangeHandler('stress', nil, function(bagName, _, value)
playerStateBagCheck(bagName, 'stress', value)
end)
2 changes: 1 addition & 1 deletion server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ exports('GetVehiclesByHash', GetVehiclesByHash)

---@return table<string, Vehicle[]>
function GetVehiclesByCategory()
return qbx.table.mapBySubfield(QBX.Shared.Vehicles, 'category')
return qbx.table.mapBySubfield(QBX.Shared.Vehicles, 'category')
end

exports('GetVehiclesByCategory', GetVehiclesByCategory)
Expand Down
4 changes: 2 additions & 2 deletions server/storage/players.lua
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ end
---Copies player's primary job/gang to the player_groups table. Works for online/offline players.
---Idempotent
RegisterCommand('convertjobs', function(source)
if source ~= 0 then return warn('This command can only be executed using the server console.') end
if source ~= 0 then return warn('This command can only be executed using the server console.') end

local players = MySQL.query.await('SELECT citizenid, JSON_VALUE(job, \'$.name\') AS jobName, JSON_VALUE(job, \'$.grade.level\') AS jobGrade, JSON_VALUE(gang, \'$.name\') AS gangName, JSON_VALUE(gang, \'$.grade.level\') AS gangGrade FROM players')
for i = 1, #players do
Expand Down Expand Up @@ -346,7 +346,7 @@ local function cleanPlayerGroups()
end

RegisterCommand('cleanplayergroups', function(source)
if source ~= 0 then return warn('This command can only be executed using the server console.') end
if source ~= 0 then return warn('This command can only be executed using the server console.') end
cleanPlayerGroups()
end, true)

Expand Down
92 changes: 46 additions & 46 deletions shared/gangs.lua
Original file line number Diff line number Diff line change
@@ -1,126 +1,126 @@
---Gang names must be lower case (top level table key)
---@type table<string, Gang>
return {
['none'] = {
label = 'No Gang',
grades = {
['none'] = {
label = 'No Gang',
grades = {
[0] = {
name = 'Unaffiliated'
},
},
},
['lostmc'] = {
label = 'The Lost MC',
grades = {
},
['lostmc'] = {
label = 'The Lost MC',
grades = {
[0] = {
name = 'Recruit'
},
[1] = {
[1] = {
name = 'Enforcer'
},
[2] = {
[2] = {
name = 'Shot Caller'
},
[3] = {
[3] = {
name = 'Boss',
isboss = true,
bankAuth = true
},
},
},
['ballas'] = {
label = 'Ballas',
grades = {
},
['ballas'] = {
label = 'Ballas',
grades = {
[0] = {
name = 'Recruit'
},
[1] = {
[1] = {
name = 'Enforcer'
},
[2] = {
[2] = {
name = 'Shot Caller'
},
[3] = {
[3] = {
name = 'Boss',
isboss = true,
bankAuth = true
},
},
},
['vagos'] = {
label = 'Vagos',
grades = {
},
['vagos'] = {
label = 'Vagos',
grades = {
[0] = {
name = 'Recruit'
},
[1] = {
[1] = {
name = 'Enforcer'
},
[2] = {
[2] = {
name = 'Shot Caller'
},
[3] = {
[3] = {
name = 'Boss',
isboss = true,
bankAuth = true
},
},
},
['cartel'] = {
label = 'Cartel',
grades = {
},
['cartel'] = {
label = 'Cartel',
grades = {
[0] = {
name = 'Recruit'
},
[1] = {
[1] = {
name = 'Enforcer'
},
[2] = {
[2] = {
name = 'Shot Caller'
},
[3] = {
[3] = {
name = 'Boss',
isboss = true,
bankAuth = true
},
},
},
['families'] = {
label = 'Families',
grades = {
},
['families'] = {
label = 'Families',
grades = {
[0] = {
name = 'Recruit'
},
[1] = {
[1] = {
name = 'Enforcer'
},
[2] = {
[2] = {
name = 'Shot Caller'
},
[3] = {
[3] = {
name = 'Boss',
isboss = true,
bankAuth = true
},
},
},
['triads'] = {
label = 'Triads',
grades = {
},
['triads'] = {
label = 'Triads',
grades = {
[0] = {
name = 'Recruit'
},
[1] = {
[1] = {
name = 'Enforcer'
},
[2] = {
[2] = {
name = 'Shot Caller'
},
[3] = {
[3] = {
name = 'Boss',
isboss = true,
bankAuth = true
},
},
}
}
}
Loading

0 comments on commit 48cbc6b

Please sign in to comment.