Skip to content

Commit d02d842

Browse files
committed
Merge tag 'v2.9.1-dev10'
# Conflicts: # ext/Shared/Registry/Registry.lua # mod.json
2 parents ce98769 + 122ca59 commit d02d842

File tree

145 files changed

+47517
-143682
lines changed

Some content is hidden

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

145 files changed

+47517
-143682
lines changed

.github/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ This is the changelog for the version V2.9 Don't forget to [join us on Discord](
2929
* Option to disable defend-mode (by tanger-noisu)
3030
* Better handling for Light AA (by tanger-noisu)
3131
* Option for Bots to spawn in Gunship-Vehicle (by tanger-noisu)
32+
* improve general attacking-logic by fixing some issues
33+
* improve speed on save of traces (by tanger-noisu)
34+
* improve general behavior
35+
* fix modlist.realoadextension
36+
* Priority-System on attack (by tanger-noisu)
3237

3338
### Bug fixes
3439
* Merged pull request #323 from tagener-noisu Path-Switcher fixes
@@ -56,6 +61,7 @@ This is the changelog for the version V2.9 Don't forget to [join us on Discord](
5661
* Conquest Small MP_007 by IgorUA
5762
* Conquest Small MP_011 by IgorUA
5863
* Conquest Small MP_012 by IgorUA
64+
* Conquest Large MP_012 by IgorUA
5965
* Conquest Small MP_013 by IgorUA
6066
* Conquest Small MP_017 by IgorUA
6167
* Conquest Small MP_018 by IgorUA

ext/Client/ClientBotManager.lua

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ function ClientBotManager:RegisterVars()
1919
self.m_LastIndex = 0
2020
self.m_Player = nil
2121
self.m_ReadyToUpdate = false
22+
---@type RaycastRequests[]
2223
self.m_BotBotRaycastsToDo = {}
2324

2425
-- Inputs for change of seats (1-8).
@@ -103,6 +104,11 @@ function ClientBotManager:OnEngineMessage(p_Message)
103104
end
104105
end
105106

107+
---@param p_Pos1 Vec3
108+
---@param p_Pos2 Vec3
109+
---@param p_InObjectPos1 boolean
110+
---@param p_InObjectPos2 boolean
111+
---@return boolean
106112
function ClientBotManager:DoRaycast(p_Pos1, p_Pos2, p_InObjectPos1, p_InObjectPos2)
107113
if Registry.COMMON.USE_COLLISION_RAYCASTS then
108114
local s_DeltaPos = p_Pos2 - p_Pos1
@@ -173,6 +179,7 @@ function ClientBotManager:DoRaycast(p_Pos1, p_Pos2, p_InObjectPos1, p_InObjectPo
173179
end
174180
end
175181

182+
---@param p_RaycastResultsToSend RaycastResults
176183
function ClientBotManager:SendRaycastResults(p_RaycastResultsToSend)
177184
NetEvents:SendLocal("Botmanager:RaycastResults", p_RaycastResultsToSend)
178185
end
@@ -203,10 +210,11 @@ function ClientBotManager:OnUpdateManagerUpdate(p_DeltaTime, p_UpdatePass)
203210

204211
for i = 1, s_MaxRaycastsBotBot do
205212
if (#self.m_BotBotRaycastsToDo > 0) then
213+
---@type RaycastRequests
206214
local s_RaycastCheckEntry = table.remove(self.m_BotBotRaycastsToDo, 1)
207215
s_RaycastEntriesDone = s_RaycastEntriesDone + 1
208-
local s_Bot1 = PlayerManager:GetPlayerByName(s_RaycastCheckEntry.Bot1)
209-
local s_Bot2 = PlayerManager:GetPlayerByName(s_RaycastCheckEntry.Bot2)
216+
local s_Bot1 = PlayerManager:GetPlayerById(s_RaycastCheckEntry.Bot1)
217+
local s_Bot2 = PlayerManager:GetPlayerById(s_RaycastCheckEntry.Bot2)
210218

211219
if s_Bot1 and s_Bot2 and s_Bot1.soldier and s_Bot2.soldier then
212220
local s_StartPos = nil
@@ -226,7 +234,7 @@ function ClientBotManager:OnUpdateManagerUpdate(p_DeltaTime, p_UpdatePass)
226234
s_EndPos.y = s_EndPos.y + 1.4
227235
if self:DoRaycast(s_StartPos, s_EndPos, s_RaycastCheckEntry.Bot1InVehicle, s_RaycastCheckEntry.Bot2InVehicle) then
228236
table.insert(s_RaycastResultsToSend, {
229-
Mode = "ShootAtBot",
237+
Mode = RaycastResultModes.ShootAtBot,
230238
Bot1 = s_RaycastCheckEntry.Bot1,
231239
Bot2 = s_RaycastCheckEntry.Bot2,
232240
IgnoreYaw = false,
@@ -320,9 +328,9 @@ function ClientBotManager:OnUpdateManagerUpdate(p_DeltaTime, p_UpdatePass)
320328
end
321329

322330
table.insert(s_RaycastResultsToSend, {
323-
Mode = "ShootAtPlayer",
324-
Bot1 = s_Bot.name,
325-
Bot2 = "",
331+
Mode = RaycastResultModes.ShootAtPlayer,
332+
Bot1 = s_Bot.id,
333+
Bot2 = 0,
326334
IgnoreYaw = s_IgnoreYaw,
327335
})
328336
end
@@ -372,9 +380,9 @@ function ClientBotManager:OnUpdateManagerUpdate(p_DeltaTime, p_UpdatePass)
372380
if self:DoRaycast(s_PlayerPosition, s_Target, false, false) then
373381
-- We found a valid bot in Sight (either no hit, or player-hit). Signal Server with players.
374382
table.insert(s_RaycastResultsToSend, {
375-
Mode = "RevivePlayer",
376-
Bot1 = s_Bot.name,
377-
Bot2 = "",
383+
Mode = RaycastResultModes.RevivePlayer,
384+
Bot1 = s_Bot.id,
385+
Bot2 = 0,
378386
IgnoreYaw = false,
379387
})
380388
end
@@ -411,7 +419,8 @@ end
411419
-- =============================================
412420
-- NetEvents
413421
-- =============================================
414-
422+
---@param p_NewConfig table<string,integer|number>
423+
---@param p_UpdateWeaponSets boolean
415424
function ClientBotManager:OnWriteClientSettings(p_NewConfig, p_UpdateWeaponSets)
416425
for l_Key, l_Value in pairs(p_NewConfig) do
417426
Config[l_Key] = l_Value

ext/Client/ClientNodeEditor.lua

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,26 @@ function ClientNodeEditor:__init()
5454
['Purple'] = Vec4(0.5, 0, 1, 1),
5555
['Ray'] = { Node = Vec4(1, 1, 1, 0.2), Line = { Vec4(1, 1, 1, 1), Vec4(0, 0, 0, 1) } },
5656
['Orphan'] = { Node = Vec4(0, 0, 0, 0.5), Line = Vec4(0, 0, 0, 1) },
57-
{ Node = Vec4(1, 0, 0, 0.25), Line = Vec4(1, 0, 0, 1) },
58-
{ Node = Vec4(1, 0.55, 0, 0.25), Line = Vec4(1, 0.55, 0, 1) },
59-
{ Node = Vec4(1, 1, 0, 0.25), Line = Vec4(1, 1, 0, 1) },
60-
{ Node = Vec4(0, 0.5, 0, 0.25), Line = Vec4(0, 0.5, 0, 1) },
61-
{ Node = Vec4(0, 0, 1, 0.25), Line = Vec4(0, 0, 1, 1) },
62-
{ Node = Vec4(0.29, 0, 0.51, 0.25), Line = Vec4(0.29, 0, 0.51, 1) },
63-
{ Node = Vec4(1, 0, 1, 0.25), Line = Vec4(1, 0, 1, 1) },
64-
{ Node = Vec4(0.55, 0, 0, 0.25), Line = Vec4(0.55, 0, 0, 1) },
65-
{ Node = Vec4(1, 0.65, 0, 0.25), Line = Vec4(1, 0.65, 0, 1) },
66-
{ Node = Vec4(0.94, 0.9, 0.55, 0.25), Line = Vec4(0.94, 0.9, 0.55, 1) },
67-
{ Node = Vec4(0.5, 1, 0, 0.25), Line = Vec4(0.5, 1, 0, 1) },
57+
{ Node = Vec4(1, 0, 0, 0.25), Line = Vec4(1, 0, 0, 1) },
58+
{ Node = Vec4(1, 0.55, 0, 0.25), Line = Vec4(1, 0.55, 0, 1) },
59+
{ Node = Vec4(1, 1, 0, 0.25), Line = Vec4(1, 1, 0, 1) },
60+
{ Node = Vec4(0, 0.5, 0, 0.25), Line = Vec4(0, 0.5, 0, 1) },
61+
{ Node = Vec4(0, 0, 1, 0.25), Line = Vec4(0, 0, 1, 1) },
62+
{ Node = Vec4(0.29, 0, 0.51, 0.25), Line = Vec4(0.29, 0, 0.51, 1) },
63+
{ Node = Vec4(1, 0, 1, 0.25), Line = Vec4(1, 0, 1, 1) },
64+
{ Node = Vec4(0.55, 0, 0, 0.25), Line = Vec4(0.55, 0, 0, 1) },
65+
{ Node = Vec4(1, 0.65, 0, 0.25), Line = Vec4(1, 0.65, 0, 1) },
66+
{ Node = Vec4(0.94, 0.9, 0.55, 0.25), Line = Vec4(0.94, 0.9, 0.55, 1) },
67+
{ Node = Vec4(0.5, 1, 0, 0.25), Line = Vec4(0.5, 1, 0, 1) },
6868
{ Node = Vec4(0.39, 0.58, 0.93, 0.25), Line = Vec4(0.39, 0.58, 0.93, 1) },
6969
{ Node = Vec4(0.86, 0.44, 0.58, 0.25), Line = Vec4(0.86, 0.44, 0.58, 1) },
7070
{ Node = Vec4(0.93, 0.51, 0.93, 0.25), Line = Vec4(0.93, 0.51, 0.93, 1) },
71-
{ Node = Vec4(1, 0.63, 0.48, 0.25), Line = Vec4(1, 0.63, 0.48, 1) },
72-
{ Node = Vec4(0.5, 0.5, 0, 0.25), Line = Vec4(0.5, 0.5, 0, 1) },
73-
{ Node = Vec4(0, 0.98, 0.6, 0.25), Line = Vec4(0, 0.98, 0.6, 1) },
71+
{ Node = Vec4(1, 0.63, 0.48, 0.25), Line = Vec4(1, 0.63, 0.48, 1) },
72+
{ Node = Vec4(0.5, 0.5, 0, 0.25), Line = Vec4(0.5, 0.5, 0, 1) },
73+
{ Node = Vec4(0, 0.98, 0.6, 0.25), Line = Vec4(0, 0.98, 0.6, 1) },
7474
{ Node = Vec4(0.18, 0.31, 0.31, 0.25), Line = Vec4(0.18, 0.31, 0.31, 1) },
75-
{ Node = Vec4(0, 1, 1, 0.25), Line = Vec4(0, 1, 1, 1) },
76-
{ Node = Vec4(1, 0.08, 0.58, 0.25), Line = Vec4(1, 0.08, 0.58, 1) },
75+
{ Node = Vec4(0, 1, 1, 0.25), Line = Vec4(0, 1, 1, 1) },
76+
{ Node = Vec4(1, 0.08, 0.58, 0.25), Line = Vec4(1, 0.08, 0.58, 1) },
7777
}
7878

7979
self.m_EventsReady = false
@@ -108,7 +108,7 @@ function ClientNodeEditor:OnRegisterEvents()
108108
Console:Register('Unlink', 'Unlink two waypoints', self, self._onUnlinkNode)
109109
Console:Register('Merge', 'Merge selected waypoints', self, self._onMergeNode)
110110
Console:Register('SelectPrevious', 'Extend selection to previous waypoint', self, self._onSelectPrevious) -- Done
111-
Console:Register('ClearSelection', 'Clear selection', self, self._onClearSelection) -- Done
111+
Console:Register('ClearSelection', 'Clear selection', self, self._onClearSelection) -- Done
112112
Console:Register('Move', 'toggle move mode on selected waypoints', self, self._onToggleMoveNode)
113113

114114
-- Add these Events to NodeEditor.
@@ -219,7 +219,6 @@ function ClientNodeEditor:_OnDrawNodes(p_NodesToDraw, p_UpdateView)
219219
-- Clear last node.
220220
self.m_LastDataPoint = nil
221221
end
222-
223222
end
224223

225224
function ClientNodeEditor:_DrawData(p_DataPoint)
@@ -391,6 +390,8 @@ function ClientNodeEditor:GetDistance(p_Position1, p_Position2)
391390
end
392391
end
393392

393+
---@param p_Position Vec3
394+
---@return nil
394395
function ClientNodeEditor:FindNode(p_Position)
395396
local s_ClosestNode = nil
396397
local s_ClosestDistance = 0.6 -- Maximum 0.6 meter.
@@ -499,8 +500,8 @@ function ClientNodeEditor:_onToggleMoveNode(p_Args)
499500
},
500501
Other = {
501502
{ Key = 'F12', Name = 'Settings' },
502-
{ Key = 'Q', Name = 'Quick Select' },
503-
{ Key = 'BS', Name = 'Clear Select' },
503+
{ Key = 'Q', Name = 'Quick Select' },
504+
{ Key = 'BS', Name = 'Clear Select' },
504505
{ Key = 'INS', Name = 'Spawn Bot' }
505506
}
506507
})
@@ -543,10 +544,10 @@ function ClientNodeEditor:_onToggleMoveNode(p_Args)
543544
{ Grid = 'K9', Key = '9', Name = 'Up' },
544545
},
545546
Other = {
546-
{ Key = 'F12', Name = 'Settings' },
547-
{ Key = 'Q', Name = 'Finish Move' },
548-
{ Key = 'BS', Name = 'Cancel Move' },
549-
{ Key = 'KP_PLUS', Name = 'Speed +' },
547+
{ Key = 'F12', Name = 'Settings' },
548+
{ Key = 'Q', Name = 'Finish Move' },
549+
{ Key = 'BS', Name = 'Cancel Move' },
550+
{ Key = 'KP_PLUS', Name = 'Speed +' },
550551
{ Key = 'KP_MINUS', Name = 'Speed -' },
551552
}
552553
})
@@ -893,7 +894,6 @@ function ClientNodeEditor:OnUpdateManagerUpdate(p_DeltaTime, p_UpdatePass)
893894

894895
-- Perform raycast to get where player is looking.
895896
if self.m_EditMode == 'move' then
896-
897897
local s_Selection = self:GetSelectedNodes()
898898

899899
if #s_Selection > 0 then
@@ -915,7 +915,6 @@ function ClientNodeEditor:OnUpdateManagerUpdate(p_DeltaTime, p_UpdatePass)
915915
local s_UpdateData = {}
916916

917917
for i = 1, #s_Selection do
918-
919918
local s_AdjustedPosition = self.m_EditNodeStartPos[s_Selection[i].Node.ID] + self.m_EditModeManualOffset
920919

921920
if self.m_EditPositionMode == 'relative' then
@@ -1024,6 +1023,9 @@ function ClientNodeEditor:DrawOBB(p_Aab, p_Transform, p_Color)
10241023
end
10251024

10261025
-- Stolen't https://github.com/EmulatorNexus/VEXT-Samples/blob/80cddf7864a2cdcaccb9efa810e65fae1baeac78/no-headglitch-raycast/ext/Client/__init__.lua
1026+
---@param p_MaxDistance number|nil
1027+
---@param p_UseAsync boolean|nil
1028+
---@return RayCastHit|nil
10271029
function ClientNodeEditor:Raycast(p_MaxDistance, p_UseAsync)
10281030
local s_Player = PlayerManager:GetLocalPlayer()
10291031
if not s_Player then
@@ -1035,6 +1037,9 @@ function ClientNodeEditor:Raycast(p_MaxDistance, p_UseAsync)
10351037
-- We get the camera transform, from which we will start the raycast. We get the direction from the forward vector. Camera transform
10361038
-- is inverted, so we have to invert this vector.
10371039
local s_Transform = ClientUtils:GetCameraTransform()
1040+
if s_Transform == nil then
1041+
return
1042+
end
10381043
local s_Direction = Vec3(-s_Transform.forward.x, -s_Transform.forward.y, -s_Transform.forward.z)
10391044

10401045
if s_Transform.trans == Vec3.zero then
@@ -1051,6 +1056,7 @@ function ClientNodeEditor:Raycast(p_MaxDistance, p_UseAsync)
10511056

10521057
-- Perform raycast, returns a RayCastHit object.
10531058

1059+
---@type RayCastFlags
10541060
local s_Flags = RayCastFlags.DontCheckWater | RayCastFlags.DontCheckCharacter | RayCastFlags.DontCheckRagdoll |
10551061
RayCastFlags.CheckDetailMesh
10561062

ext/Client/ClientSpawnPointHelper.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function ClientSpawnPointHelper:OnUIDrawHud()
5757
end
5858

5959
for _, l_Transform in pairs(self.m_SpawnPointTable) do
60-
if l_Transform.trans:Distance(s_LocalPlayer.soldier.transform.trans) <= Config.SpawnPointRange then
60+
if l_Transform.trans:Distance(s_LocalPlayer.soldier.worldTransform.trans) <= Config.SpawnPointRange then
6161
self:DrawSpawnPoint(l_Transform)
6262
end
6363
end

ext/Client/__init__.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ end
164164
-- =============================================
165165
-- NetEvents
166166
-- =============================================
167-
167+
---@param p_NewConfig table
168+
---@param p_UpdateWeaponSets boolean
168169
function FunBotClient:OnWriteClientSettings(p_NewConfig, p_UpdateWeaponSets)
169170
m_ClientBotManager:OnWriteClientSettings(p_NewConfig, p_UpdateWeaponSets)
170171

@@ -175,14 +176,17 @@ function FunBotClient:OnWriteClientSettings(p_NewConfig, p_UpdateWeaponSets)
175176
end
176177
end
177178

179+
---@param p_RaycastData RaycastRequests
178180
function FunBotClient:CheckForBotBotAttack(p_RaycastData)
179181
m_ClientBotManager:CheckForBotBotAttack(p_RaycastData)
180182
end
181183

184+
---@param p_Data any
182185
function FunBotClient:OnUISettings(p_Data)
183186
m_ClientNodeEditor:OnUISettings(p_Data)
184187
end
185188

189+
---@param p_ConfigList table
186190
function FunBotClient:OnRegisterConsoleCommands(p_ConfigList)
187191
m_ConsoleCommands:OnRegisterConsoleCommands(p_ConfigList)
188192
end

ext/Server/AirTargets.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---@class AirTargets
22
---@overload fun():AirTargets
33
AirTargets = class('AirTargets')
4-
5-
---@type Utilities
6-
local m_Utilities = require('__shared/Utilities')
74
---@type Vehicles
85
local m_Vehicles = require('Vehicles')
96

@@ -48,6 +45,8 @@ function AirTargets:OnPlayerDestroyed(p_Player)
4845
end
4946

5047
-- Public functions
48+
---@param p_Player Player
49+
---@param p_MaxDistance number
5150
function AirTargets:GetTarget(p_Player, p_MaxDistance)
5251
local s_Team = p_Player.teamId
5352
local s_ClosestDistance = nil
@@ -90,17 +89,18 @@ function AirTargets:GetTarget(p_Player, p_MaxDistance)
9089
end
9190

9291
-- Private functions
93-
92+
---comment
93+
---@param p_Player Player
9494
function AirTargets:_CreateTarget(p_Player)
9595
if p_Player.controlledEntryId == 0 then
96-
local s_Vehicle = m_Vehicles:GetVehicle(p_Player, 0)
97-
98-
if m_Vehicles:IsAirVehicle(s_Vehicle) then
96+
local s_Vehicle = m_Vehicles:GetVehicle(p_Player)
97+
if s_Vehicle and m_Vehicles:IsAirVehicle(s_Vehicle) then
9998
table.insert(self._Targets, p_Player.name)
10099
end
101100
end
102101
end
103102

103+
---@param p_Player Player
104104
function AirTargets:_RemoveTarget(p_Player)
105105
for l_Index, l_Target in pairs(self._Targets) do
106106
if l_Target == p_Player.name then

0 commit comments

Comments
 (0)