mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
Only set controls.jump to true for one frame when jumping
This commit is contained in:
parent
aae74224e8
commit
d7bd50e45f
@ -83,6 +83,7 @@ end
|
|||||||
local movementControlsOverridden = false
|
local movementControlsOverridden = false
|
||||||
|
|
||||||
local autoMove = false
|
local autoMove = false
|
||||||
|
local attemptToJump = false
|
||||||
local function processMovement()
|
local function processMovement()
|
||||||
local movement = input.getRangeActionValue('MoveForward') - input.getRangeActionValue('MoveBackward')
|
local movement = input.getRangeActionValue('MoveForward') - input.getRangeActionValue('MoveBackward')
|
||||||
local sideMovement = input.getRangeActionValue('MoveRight') - input.getRangeActionValue('MoveLeft')
|
local sideMovement = input.getRangeActionValue('MoveRight') - input.getRangeActionValue('MoveLeft')
|
||||||
@ -97,6 +98,7 @@ local function processMovement()
|
|||||||
self.controls.movement = movement
|
self.controls.movement = movement
|
||||||
self.controls.sideMovement = sideMovement
|
self.controls.sideMovement = sideMovement
|
||||||
self.controls.run = run
|
self.controls.run = run
|
||||||
|
self.controls.jump = attemptToJump
|
||||||
|
|
||||||
if not settings:get('toggleSneak') then
|
if not settings:get('toggleSneak') then
|
||||||
self.controls.sneak = input.getBooleanActionValue('Sneak')
|
self.controls.sneak = input.getBooleanActionValue('Sneak')
|
||||||
@ -115,7 +117,7 @@ end
|
|||||||
|
|
||||||
input.registerTriggerHandler('Jump', async:callback(function()
|
input.registerTriggerHandler('Jump', async:callback(function()
|
||||||
if not movementAllowed() then return end
|
if not movementAllowed() then return end
|
||||||
self.controls.jump = Player.getControlSwitch(self, Player.CONTROL_SWITCH.Jumping)
|
attemptToJump = Player.getControlSwitch(self, Player.CONTROL_SWITCH.Jumping)
|
||||||
end))
|
end))
|
||||||
|
|
||||||
input.registerTriggerHandler('ToggleSneak', async:callback(function()
|
input.registerTriggerHandler('ToggleSneak', async:callback(function()
|
||||||
@ -223,6 +225,7 @@ local function onFrame(_)
|
|||||||
if combatAllowed() then
|
if combatAllowed() then
|
||||||
processAttacking()
|
processAttacking()
|
||||||
end
|
end
|
||||||
|
attemptToJump = false
|
||||||
end
|
end
|
||||||
|
|
||||||
local function onSave()
|
local function onSave()
|
||||||
|
Loading…
Reference in New Issue
Block a user