Skip to content

Commit 3ebef1e

Browse files
authored
Merge pull request #120 from acidlabsdev/main
chore: update for Legacy b3788.0
2 parents 40e6899 + 0ebc9bf commit 3ebef1e

16 files changed

Lines changed: 98 additions & 110 deletions

File tree

.github/workflows/zip-release.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
release:
1414
name: CI Main
1515
runs-on: ubuntu-latest
16-
if: "! contains(github.event.head_commit.message, '[noci]')"
16+
if: "!contains(github.event.head_commit.message, '[noci]')"
1717
env:
1818
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1919

@@ -115,14 +115,6 @@ jobs:
115115
}
116116
117117
const mergedPRs = pulls.filter(pr => pr.merged_at && new Date(pr.merged_at) > lastTagDate);
118-
const extractField = (body, fieldName) => {
119-
const regex = new RegExp(`${fieldName}:\\s*([\\s\\S]*?)(?=\\n\\w+:|$)`, 'm');
120-
const match = body.match(regex);
121-
if (!match)
122-
return "";
123-
124-
return match[1].trim();
125-
};
126118
127119
if (mergedPRs.length > 0) {
128120
for (const pr of mergedPRs) {

SSV2/includes/backend.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function Backend:debug(data, ...)
155155
end
156156

157157
function Backend:MatchGameVersion()
158-
local gv = Game.GetVersion()
158+
local gv = Memory:GetGameVersion()
159159
return (gv and gv.build
160160
and gv.online
161161
and (self.target_build == gv.build)

SSV2/includes/classes/gta/CPlayerInfo.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ local CStructView = require("includes.classes.gta.CStructView")
1717
---@class CPlayerInfo : CStructBase<CPlayerInfo>
1818
---@field protected m_ptr pointer
1919
---@field m_swim_speed pointer<float>
20+
---@field m_walk_speed pointer<float>
2021
---@field m_game_state pointer<eGameState>
2122
---@field m_is_wanted pointer<bool>
2223
---@field m_wanted_level pointer<uint32_t>
@@ -35,6 +36,7 @@ function CPlayerInfo.new(ptr)
3536
return setmetatable({
3637
m_ptr = ptr,
3738
m_swim_speed = ptr:add(0x01C8),
39+
m_walk_speed = ptr:add(0x01E4),
3840
m_game_state = ptr:add(0x0230),
3941
m_is_wanted = ptr:add(0x08E0),
4042
m_wanted_level = ptr:add(0x08E8),

SSV2/includes/data/globals_locals.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ return {
2727
file = "freemode.c",
2828
LEGACY = {
2929
value = 1673807,
30-
pattern = [[if \(Global_\d{7}\[.*?\] != 0 && func_\w+\(.*?\) && \w+\)]],
30+
pattern = [[if.*?Global_\d{7}\[.*?\] != 0 && func_\w+\(.*?\) && \w+\)]],
3131
capture_group = 1
3232
},
3333
ENHANCED = {
3434
value = 1673814,
35-
pattern = [[if \(Global_\d{7}\[.*?\] != 0 && func_\w+\(.*?\) && \w+\)]],
35+
pattern = [[if.*?Global_\d{7}\[.*?\] != 0 && func_\w+\(.*?\) && \w+\)]],
3636
capture_group = 1
3737
}
3838
},
@@ -137,12 +137,12 @@ return {
137137
file = "freemode.c",
138138
LEGACY = {
139139
value = 2708951,
140-
pattern = [[Global_(\d{7})\[.*?\] = Global_\d{7}\[.*?\] +.*?Global_(\d{7})\.(f_1)\[.*?\] - .*?;]],
140+
pattern = [[Global_(\d{7})\[.*?\] =.*?Global_\d{7}\[.*?\] +.*?Global_(\d{7})\.(f_1)\[.*?\] - .*?;]],
141141
capture_group = 1
142142
},
143143
ENHANCED = {
144144
value = 2709086,
145-
pattern = [[Global_(\d{7})\[.*?\] = Global_\d{7}\[.*?\] +.*?Global_(\d{7})\.(f_1)\[.*?\] - .*?;]],
145+
pattern = [[Global_(\d{7})\[.*?\] =.*?Global_\d{7}\[.*?\] +.*?Global_(\d{7})\.(f_1)\[.*?\] - .*?;]],
146146
capture_group = 1
147147
}
148148
},
@@ -151,7 +151,7 @@ return {
151151
file = "freemode.c",
152152
LEGACY = {
153153
value = 2708962,
154-
pattern = [[Global_(\d{7})\[.*?\] = Global_\d{7}\[.*?\] +.*?Global_(\d{7})\.(f_1)\[.*?\] - .*?;]],
154+
pattern = [[Global_(\d{7})\[.*?\] =.*?Global_\d{7}\[.*?\] +.*?Global_(\d{7})\.(f_1)\[.*?\] - .*?;]],
155155
capture_group = 2,
156156
offsets = {
157157
{
@@ -785,7 +785,7 @@ return {
785785
{
786786
value = 14,
787787
capture_group = 2,
788-
description = "grab speed"
788+
description = "scene rate"
789789
}
790790
}
791791
},
@@ -797,7 +797,7 @@ return {
797797
{
798798
value = 14,
799799
capture_group = 2,
800-
description = "grab speed"
800+
description = "scene rate"
801801
}
802802
}
803803
}

SSV2/includes/data/pointers.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ local mem_batches <const> = {
7373
online = pOnlineVersion:get_string()
7474
}
7575
end),
76-
MemoryBatch.new("GameState", "83 3D ? ? ? ? ? 75 17 8B 43 20 25", function(ptr)
77-
GPointers.GameState = ptr:add(0x2):rip():add(0x1)
76+
MemoryBatch.new("GameState", "81 39 5D 6D FF AF 75 20", function(ptr)
77+
GPointers.GameState = ptr:add(0xA):rip():add(0x1)
7878
end),
7979
MemoryBatch.new("GameTime", "8B 05 ? ? ? ? 89 ? 48 8D 4D C8", function(ptr)
8080
GPointers.GameTime = ptr:add(0x2):rip()

SSV2/includes/features/CasinoPacino.lua

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -480,12 +480,9 @@ function CasinoPacino:BypassCooldown()
480480
end
481481

482482
function CasinoPacino:Main()
483-
if (not Backend:IsUpToDate() and self.m_thread and self.m_thread:IsRunning()) then
484-
self.m_thread:Stop()
485-
end
483+
yield()
486484

487485
if (not self:CanAccess()) then
488-
sleep(500)
489486
return
490487
end
491488

SSV2/includes/features/YimActionsV3.lua

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function YimActions:init()
5050
end)
5151

5252
ThreadManager:RegisterLooped("SS_YIMACTIONS", function()
53-
self:MainThread()
53+
self:OnTick()
5454
end)
5555

5656
self.m_initialized = true
@@ -127,7 +127,7 @@ function YimActions:IsPlayerBusy()
127127
or LocalPlayer:IsBrowsingApps()
128128
or LocalPlayer:IsInWater()
129129
or LocalPlayer:IsRagdoll()
130-
or script.is_active("maintransition")
130+
or Game.IsInNetworkTransition()
131131
or Backend:IsPlayerSwitchInProgress()
132132
or Backend:AreControlsDisabled()
133133
end
@@ -227,16 +227,16 @@ function YimActions:PlayAnim(animData, targetPed)
227227

228228
if (not GVars.features.yim_actions.disable_props) then
229229
if (animData.props and #animData.props > 0) then
230-
YimActions.PropManager:AttachProp(targetPed, animData.props)
230+
self.PropManager:AttachProp(targetPed, animData.props)
231231
end
232232

233233
if (animData.propPeds and #animData.propPeds > 0) then
234-
YimActions.PropManager:AttachProp(targetPed, animData.propPeds, true)
234+
self.PropManager:AttachProp(targetPed, animData.propPeds, true)
235235
end
236236
end
237237

238238
if (not GVars.features.yim_actions.disable_ptfx and animData.ptfx and animData.ptfx.name) then
239-
YimActions.FXManager:StartPTFX(targetPed, animData.ptfx)
239+
self.FXManager:StartPTFX(targetPed, animData.ptfx)
240240
end
241241

242242
local isLooped = Bit.IsBitSet(animData.flags, Enums.eAnimFlags.LOOPING)
@@ -264,7 +264,7 @@ function YimActions:PlayScenario(scenarioData, targetPed, playImmediately)
264264
0.0
265265
)
266266

267-
local bbq = YimActions.PropManager:SpawnProp(
267+
local bbq = self.PropManager:SpawnProp(
268268
targetPed,
269269
{ model = 286252949 },
270270
false,
@@ -307,8 +307,7 @@ function YimActions:Play(action, ped)
307307
ped = self:GetPed(ped)
308308

309309
if (ped == LocalPlayer:GetHandle() and self:IsPlayerBusy()) then
310-
Notifier:ShowMessage(
311-
"Samurai's Scripts",
310+
Notifier:ShowMessage("YimActions",
312311
"Player is unavailable at this moment. Clear any other tasks then try again."
313312
)
314313
return
@@ -364,7 +363,7 @@ function YimActions:Cleanup(ped)
364363
self.SceneManager:Wipe()
365364

366365
if (string.find(self.CurrentlyPlaying[ped].data.label, "DJ")) then
367-
Audio:PartyMode(false)
366+
Audio:PartyMode(false, ped)
368367
end
369368

370369
sleep(200)
@@ -393,15 +392,15 @@ function YimActions:ForceCleanup()
393392
self.PropManager:Wipe()
394393
self.SceneManager:Wipe()
395394
self.CompanionManager:Wipe()
396-
self.CurrentlyPlaying = {}
397395
self:ResetPlayer()
398396
Audio:StopAllEmitters()
399397
LocalPlayer:ClearTasks()
398+
self.CurrentlyPlaying = {}
400399
end
401400

402401
function YimActions:OnInterruptEvent()
403-
local localPlayer = LocalPlayer:GetHandle()
404-
local current = self.CurrentlyPlaying[localPlayer]
402+
local playerHandle = LocalPlayer:GetHandle()
403+
local current = self.CurrentlyPlaying[playerHandle]
405404
if (not current) then
406405
yield()
407406
return
@@ -419,34 +418,34 @@ function YimActions:OnInterruptEvent()
419418
return
420419
end
421420

422-
if (not LocalPlayer:IsAlive() or LocalPlayer:IsBeingArrested() or Backend:IsPlayerSwitchInProgress() or script.is_active("maintransition")) then
421+
if (not LocalPlayer:IsAlive() or LocalPlayer:IsBeingArrested() or Backend:IsPlayerSwitchInProgress() or Game.IsInNetworkTransition()) then
423422
self:ForceCleanup()
424-
sleep(1000)
423+
yield()
425424
return
426425
end
427426

428-
if (current and self:WasActionInterrupted(localPlayer)) then
427+
if (current and self:WasActionInterrupted(playerHandle)) then
429428
if (LocalPlayer:IsFalling()) then
430429
repeat
431-
sleep(1000)
430+
yield()
432431
until not LocalPlayer:IsFalling()
433432
sleep(1000)
434433
end
435434

436-
if LocalPlayer:IsRagdoll() then
435+
if (LocalPlayer:IsRagdoll()) then
437436
repeat
438-
sleep(1000)
437+
yield()
439438
until not LocalPlayer:IsRagdoll()
440439
sleep(1000)
441440
end
442441

443-
if LocalPlayer:IsSwimming() then
444-
self:Cleanup(localPlayer)
442+
if (LocalPlayer:IsSwimming()) then
443+
self:Cleanup(playerHandle)
445444
sleep(1000)
446445
return
447446
end
448447

449-
self:Play(current, localPlayer)
448+
self:Play(current, playerHandle)
450449
end
451450
end
452451

@@ -631,7 +630,7 @@ function YimActions:GoofyUnaliveAnim()
631630
end)
632631
end
633632

634-
function YimActions:HandleCleanupKeybind()
633+
function YimActions:OnKeyDown()
635634
if (KeyManager:IsKeybindJustPressed("stop_anim")) then
636635
ThreadManager:Run(function()
637636
local timer = Timer.new(1000)
@@ -652,15 +651,15 @@ function YimActions:HandleCleanupKeybind()
652651
end
653652
end
654653

655-
function YimActions:MainThread()
654+
function YimActions:OnTick()
656655
if (next(self.CurrentlyPlaying) == nil)
657656
and (next(self.PropManager.Props) == nil)
658657
and (#self.CompanionManager.Companions == 0) then
659658
yield()
660659
return
661660
end
662661

663-
self:HandleCleanupKeybind()
662+
self:OnKeyDown()
664663

665664
local ped = LocalPlayer:GetHandle()
666665
local current = self.CurrentlyPlaying[ped]

SSV2/includes/features/YimResupplierV3.lua

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,14 @@ function YRV3:init()
117117
self:OnTick()
118118
end)
119119

120-
Backend:RegisterEventCallback(Enums.eBackendEvent.RELOAD_UNLOAD, function()
120+
local function __reset__()
121121
if (self.m_data_initialized) then
122122
self:Reset()
123123
end
124-
end)
124+
end
125125

126-
Backend:RegisterEventCallback(Enums.eBackendEvent.SESSION_SWITCH, function()
127-
if (self.m_data_initialized) then
128-
self:Reset()
129-
end
130-
end)
126+
Backend:RegisterEventCallback(Enums.eBackendEvent.RELOAD_UNLOAD, __reset__)
127+
Backend:RegisterEventCallback(Enums.eBackendEvent.SESSION_SWITCH, __reset__)
131128

132129
return self
133130
end
@@ -1074,10 +1071,11 @@ function YRV3:CalculateEstimatedIncome()
10741071
end
10751072

10761073
function YRV3:OnTick()
1077-
if (not Backend:IsUpToDate() and (self.m_thread and self.m_thread:IsRunning())) then
1074+
yield()
1075+
1076+
if (not Backend:IsUpToDate()) then
10781077
self.m_state = Enums.eYRState.ERROR
10791078
self:SetLastError("GENERIC_OUTDATED")
1080-
self.m_thread:Stop()
10811079
return
10821080
end
10831081

@@ -1100,7 +1098,6 @@ function YRV3:OnTick()
11001098
end
11011099
end
11021100

1103-
yield()
11041101
return
11051102
end
11061103

SSV2/includes/frontend/settings/debug_ui.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ local function DrawThreads()
172172
end
173173

174174
if GUI:Button("Kill", { size = side_button_size }) then
175-
ThreadManager:StopThread(thread_name)
175+
ThreadManager:TerminateThread(thread_name)
176176
end
177177
else
178178
if (thread_state == eThreadState.SUSPENDED) then

SSV2/includes/init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ local DEFAULT_CONFIG <const> = require("includes.data.config")
2626

2727
---@type GAME_VERSION
2828
local GAME_VERSION <const> = {
29-
{ build = "3751.0", online = "1.72" },
29+
{ build = "3788.0", online = "1.72" },
3030
{ build = "1013.29", online = "1.72" },
3131
}
3232

@@ -83,7 +83,7 @@ require("includes.modules.Color")
8383
GPointers = require("includes.data.pointers")
8484
Memory = require("includes.modules.Memory")
8585
KeyManager = require("includes.services.KeyManager"):init()
86-
GUI = require("includes.services.GUI"):init()
86+
GUI = require("includes.services.GUI")
8787
Notifier = require("includes.services.ToastNotifier").new()
8888
CommandExecutor = require("includes.services.CommandExecutor"):init()
8989
----------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)