Skip to content

Commit 5e5ca94

Browse files
authored
Merge pull request #95 from acidlabsdev/main
fix(Python): normalize line endings
2 parents ceb9701 + 566eee5 commit 5e5ca94

45 files changed

Lines changed: 1053 additions & 396 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/translations.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,5 @@ jobs:
3737
git config user.name "github-actions[bot]"
3838
git config user.email "github-actions[bot]@users.noreply.github.com"
3939
git add SSV2/includes/lib/translations/
40-
git add scripts/translations/hashmap.json || true
4140
git diff --cached --quiet || git commit -m "feat(Translations): update translations"
4241
git push

SSV2/includes/classes/Set.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,16 @@ function Set:Push(element)
4949
return
5050
end
5151

52+
if (self.m_data[element] == true) then
53+
return
54+
end
55+
5256
local __type = type(element)
5357
if (not self.m_data_type) then
5458
self.m_data_type = __type
5559
elseif (__type ~= self.m_data_type) then
5660
error(_F(
57-
"[Set]: Data type mismatch! A set can only be created with same-type objects. %s expected, got %s instead.",
61+
"[Set]: Data type mismatch! A set can only contain unique same-type objects. %s expected, got %s instead.",
5862
self.m_data_type,
5963
__type
6064
))

SSV2/includes/classes/gta/atArray.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
---@field private m_count uint16_t
2020
---@field private m_data array<pointer>
2121
---@field private m_data_type any
22-
---@field private m_last_update_time Time.TimePoint
22+
---@field private m_last_update_time TimePoint
2323
---@overload fun(address: pointer, data_type?: any): atArray
2424
atArray = {}
2525
atArray.__index = atArray

SSV2/includes/data/config.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ local Config <const> = {
300300
sy_always_max_income = false,
301301
sy_disable_rob_cd = false,
302302
sy_disable_rob_weekly_cd = false,
303+
sy_disable_tow_cd = false,
303304
safe_loop_warn_ack = false,
304305
},
305306
bsv2 = {

SSV2/includes/data/yrv3_data.lua

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,17 @@ local RawBusinessData <const> = {
257257
end
258258
end
259259
},
260+
["sy_disable_tow_cd"] = {
261+
dirty = false,
262+
gstate = function()
263+
return GVars.features.yrv3.sy_disable_tow_cd
264+
end,
265+
onEnable = function()
266+
if (tunables.get_int(1521767918) > 0) then -- 120000ms
267+
tunables.set_int(1521767918, 0)
268+
end
269+
end
270+
},
260271
},
261272
SellScripts = {
262273
["gb_smuggler"] = { -- air
@@ -483,10 +494,10 @@ local RawBusinessData <const> = {
483494
{ gxt = "MP_PROP_CLUBH12", coords = vec3:new(-1138.0574, -1572.1804, 3.4157) },
484495
},
485496
SalvageYards = {
486-
{ gxt = "CELL_SLVG_YRD", coords = vec3:new(-195.6784, 6266.2856, 31.4892) }, -- func_3737 // case 162:
497+
{ gxt = "CELL_SLVG_YRD", coords = vec3:new(-195.0317, 6269.1601, 31.4892) }, -- func_3737 // case 162:
487498
{ gxt = "CELL_SLVG_YRD", coords = vec3:new(2508.7229, 4110.6401, 38.3481) },
488499
{ gxt = "CELL_SLVG_YRD", coords = vec3:new(-509.6919, -1735.85, 19.1262) },
489-
{ gxt = "CELL_SLVG_YRD", coords = vec3:new(-12.9673, -1309.9194, 29.2606) },
500+
{ gxt = "CELL_SLVG_YRD", coords = vec3:new(-15.3909, -1307.951, 29.2440) },
490501
{ gxt = "CELL_SLVG_YRD", coords = vec3:new(1194.7052, -1263.8588, 35.2128) },
491502
},
492503
-- index + 127

SSV2/includes/features/CasinoPacino.lua

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function CasinoPacino:GetCardNameFromIndex(card_index)
112112
end
113113

114114
function CasinoPacino:ForceDealerBust()
115-
script.run_in_fiber(function(script)
115+
ThreadManager:Run(function(s)
116116
local player_id = Self:GetPlayerID()
117117
local bjc_obj = SGSL:Get(SGSL.data.blackjack_cards)
118118
local btp_obj = SGSL:Get(SGSL.data.blackjack_table_players)
@@ -130,16 +130,22 @@ function CasinoPacino:ForceDealerBust()
130130
return
131131
end
132132

133-
while (
134-
(NETWORK.NETWORK_GET_HOST_OF_SCRIPT("blackjack", -1, 0) ~= player_id)
135-
and (NETWORK.NETWORK_GET_HOST_OF_SCRIPT("blackjack", 0, 0) ~= player_id)
136-
and (NETWORK.NETWORK_GET_HOST_OF_SCRIPT("blackjack", 1, 0) ~= player_id)
137-
and (NETWORK.NETWORK_GET_HOST_OF_SCRIPT("blackjack", 2, 0) ~= player_id)
138-
and (NETWORK.NETWORK_GET_HOST_OF_SCRIPT("blackjack", 3, 0) ~= player_id)
139-
) do
133+
local giveupTimer = Timer.new(3e4)
134+
local success = true
135+
Notifier:ShowMessage("Casino Pacino", _T("CP_BLACKJACK_SCRIPT_CONTROL"))
136+
while (not Self:IsHostOfScript("blackjack")) do
137+
if (giveupTimer:is_done()) then
138+
success = false
139+
break
140+
end
141+
140142
network.force_script_host("blackjack")
141-
Notifier:ShowMessage("CasinoPacino", _T("CP_BLACKJACK_SCRIPT_CONTROL")) --If you see this spammed, someone is fighting you for control.
142-
script:yield()
143+
s:yield()
144+
end
145+
146+
if (not success) then
147+
Notifier:ShowError("Casino Pacino", _T("GENERIC_SCRIPT_CTRL_FAIL"))
148+
return
143149
end
144150

145151
local blackjack_table = locals.get_int("blackjack",

SSV2/includes/features/YimActionsV3.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ end
893893
-----------------------------------------------------
894894
-- Handles sound and visual effects.
895895
---@class YimActions.FXManager
896-
---@field SFXTimers table<handle, Time.Timer>
896+
---@field SFXTimers table<handle, Timer>
897897
YimActions.FXManager = { Fx = {} }
898898
YimActions.FXManager.__index = YimActions.FXManager
899899
YimActions.FXManager.SFXTimers = {}

SSV2/includes/features/YimResupplierV3.lua

Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -796,16 +796,13 @@ function YRV3:FinishSale()
796796

797797
self.m_has_triggered_autosell = true
798798
script.execute_as_script(sn, function()
799-
if not self.m_raw_data.SellScripts[sn].b then -- gb_*
799+
if (not self.m_raw_data.SellScripts[sn].b) then
800800
for _, data in pairs(self.m_raw_data.SellScripts[sn]) do
801801
locals.set_int(sn, data.l + data.o, data.v)
802802
end
803-
else -- fm_content_*
804-
if (NETWORK.NETWORK_GET_HOST_OF_THIS_SCRIPT() ~= Self:GetPlayerID()) then
805-
Notifier:ShowWarning(
806-
"YRV3",
807-
"Unable to finish sale mission. You are not host of this script."
808-
)
803+
else
804+
if (not Self:IsHostOfScript(sn)) then
805+
Notifier:ShowError("YRV3", _T("YRV3_SCRIPT_HOST_ERR"))
809806
return
810807
end
811808

@@ -821,38 +818,34 @@ function YRV3:FinishSale()
821818
end
822819

823820
function YRV3:FinishCEOCargoSourceMission()
824-
if script.is_active("gb_contraband_buy") then
825-
script.execute_as_script("gb_contraband_buy", function()
826-
if (not NETWORK.NETWORK_IS_HOST_OF_THIS_SCRIPT()) then
827-
Notifier:ShowError("YRV3", "You are not host of this script.")
828-
return
829-
end
821+
if (script.is_active("gb_contraband_buy")) then
822+
if (not Self:IsHostOfScript("gb_contraband_buy")) then
823+
Notifier:ShowError("YRV3", _T("YRV3_SCRIPT_HOST_ERR"))
824+
return
825+
end
830826

831-
local buyLocal = SGSL:Get(SGSL.data.gb_contraband_buy_local_1):AsLocal()
832-
buyLocal:At(5):WriteInt(1) -- 1.71 b3568.0 -- case -1: return "INVALID - UNSET";
833-
buyLocal:At(191):WriteInt(6) -- 1.71 b3568.0 -- Local_623.f_191 = iParam0;
834-
buyLocal:At(192):WriteInt(4) -- 1.71 b3568.0 -- Local_623.f_192 = iParam0;
835-
end)
836-
elseif script.is_active("fm_content_cargo") then
837-
script.execute_as_script("fm_content_cargo", function()
838-
if not NETWORK.NETWORK_IS_HOST_OF_THIS_SCRIPT() then
839-
Notifier:ShowError("YRV3", "You are not host of this script.")
840-
return
841-
end
827+
local buyLocal = SGSL:Get(SGSL.data.gb_contraband_buy_local_1):AsLocal()
828+
buyLocal:At(5):WriteInt(1)
829+
buyLocal:At(191):WriteInt(6)
830+
buyLocal:At(192):WriteInt(4)
831+
elseif (script.is_active("fm_content_cargo")) then
832+
if (not Self:IsHostOfScript("fm_content_cargo")) then
833+
Notifier:ShowError("YRV3", _T("YRV3_SCRIPT_HOST_ERR"))
834+
return
835+
end
842836

843-
local fmccLocal2 = SGSL:Get(SGSL.data.gb_contraband_buy_local_2):AsLocal():At(1):At(0) -- GENERIC_BITSET_I_WON -- 1.71 b3568.0: var uLocal_5973 = 4;
844-
local gbcb_obj = SGSL:Get(SGSL.data.gb_contraband_buy_local_3)
845-
local fmccLocal3 = gbcb_obj:AsLocal()
846-
local fmccLocal3Offset = gbcb_obj:GetOffset(1)
847-
local bs = fmccLocal2:ReadInt()
837+
local fmccLocal2 = SGSL:Get(SGSL.data.gb_contraband_buy_local_2):AsLocal():At(1):At(0)
838+
local gbcb_obj = SGSL:Get(SGSL.data.gb_contraband_buy_local_3)
839+
local fmccLocal3 = gbcb_obj:AsLocal()
840+
local fmccLocal3Offset = gbcb_obj:GetOffset(1)
841+
local bs = fmccLocal2:ReadInt()
848842

849-
if (not Bit.is_set(bs, 11)) then
850-
bs = Bit.set(bs, 11)
851-
fmccLocal2:WriteInt(bs)
852-
end
843+
if (not Bit.is_set(bs, 11)) then
844+
bs = Bit.set(bs, 11)
845+
fmccLocal2:WriteInt(bs)
846+
end
853847

854-
fmccLocal3:At(fmccLocal3Offset):WriteInt(3) -- EndReason
855-
end)
848+
fmccLocal3:At(fmccLocal3Offset):WriteInt(3)
856849
end
857850
end
858851

SSV2/includes/features/vehicle/iv_style_exit.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ local FeatureBase = require("includes.modules.FeatureBase")
1212
---@class IVStyleExit : FeatureBase
1313
---@field private m_entity PlayerVehicle
1414
---@field private m_triggered boolean
15-
---@field private m_timer Time.Timer
16-
---@field private m_steering_timer Time.Timer
15+
---@field private m_timer Timer
16+
---@field private m_steering_timer Timer
1717
---@field private m_pending_steering boolean
1818
---@field private m_last_steer_angle float
1919
local IVStyleExit = setmetatable({}, FeatureBase)

SSV2/includes/features/vehicle/launch_control.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ local eLaunchControlState <const> = {
2828
---@field private m_is_active boolean
2929
---@field private m_thread? Thread
3030
---@field private m_state eLaunchControlState
31-
---@field private m_timer Time.Timer
31+
---@field private m_timer Timer
3232
---@field private m_last_pop_time milliseconds
3333
---@field private m_default_pops_off boolean
3434
---@field private m_shocking_event_handle? handle

0 commit comments

Comments
 (0)