Skip to content

Commit 9755c11

Browse files
authored
Fix desyncs in replays and/or multiplayer when using debug functionality (FAForever#6830)
1 parent b43432b commit 9755c11

2 files changed

Lines changed: 1 addition & 39 deletions

File tree

changelog/snippets/fix.6830.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- (#6830) Fix unit/projectile/weapon debug component logging and drawing causing desyncs.

lua/SimHooks.lua

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -39,45 +39,6 @@ do
3939
end
4040
end
4141

42-
do
43-
44-
-- upvalue for performance
45-
local Random = Random
46-
47-
local oldDrawCircle = _G.DrawCircle
48-
_G.DrawCircle = function(position, diameter, color)
49-
50-
-- cause a desync when players during non-ai games try and call this function separate from other players
51-
if not ScenarioInfo.GameHasAIs then
52-
Random()
53-
end
54-
55-
oldDrawCircle(position, diameter, color)
56-
end
57-
58-
local oldDrawLine = _G.DrawLine
59-
_G.DrawLine = function(a, b, color)
60-
61-
-- cause a desync when players during non-ai games try and call this function separate from other players
62-
if not ScenarioInfo.GameHasAIs then
63-
Random()
64-
end
65-
66-
oldDrawLine(a, b, color)
67-
end
68-
69-
local oldDrawLinePop = _G.DrawLinePop
70-
_G.DrawLinePop = function(a, b, color)
71-
72-
-- cause a desync when players during non-ai games try and call this function separate from other players
73-
if not ScenarioInfo.GameHasAIs then
74-
Random()
75-
end
76-
77-
oldDrawLinePop(a, b, color)
78-
end
79-
end
80-
8142
do
8243
-- do not allow command units to be given
8344
local oldChangeUnitArmy = _G.ChangeUnitArmy

0 commit comments

Comments
 (0)