Skip to content

Commit 94ce381

Browse files
committed
Fix function overwrite
1 parent c8133ca commit 94ce381

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

scripts/specializations/CpHud.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ function CpHud.registerOverwrittenFunctions(vehicleType)
8282
SpecializationUtil.registerOverwrittenFunction(vehicleType, "enterVehicleRaycastClickToSwitch", CpHud.enterVehicleRaycastClickToSwitch)
8383
end
8484
SpecializationUtil.registerOverwrittenFunction(vehicleType, 'getCpStartText', CpHud.getCpStartText)
85-
SpecializationUtil.registerOverwrittenFunction(vehicleType, 'actionEventCameraZoomInOut', CpHud.actionEventCameraZoomInOut)
8685
end
8786

8887
--- Disables the click to switch action, while the mouse is over the cp hud.
@@ -314,12 +313,13 @@ function CpHud:onLeaveVehicle(wasEntered)
314313
end
315314

316315
---- Disables zoom, while mouse is over the cp hud.
317-
function CpHud:actionEventCameraZoomInOut(self, superFunc, ...)
318-
if self:getIsMouseOverCpHud() then
316+
local function actionEventCameraZoomInOut(self, superFunc, ...)
317+
if self.getIsMouseOverCpHud and self:getIsMouseOverCpHud() then
319318
return
320319
end
321320
return superFunc(self, ...)
322-
end
321+
end
322+
Enterable.actionEventCameraZoomInOut = Utils.overwrittenFunction(Enterable.actionEventCameraZoomInOut, actionEventCameraZoomInOut)
323323

324324
function CpHud:onStateChange(state, data)
325325
local spec = self.spec_cpHud

0 commit comments

Comments
 (0)