Merge pull request #15 from cuckydev/fix-input-tas

Fix TAS input
This commit is contained in:
Max 2023-07-08 20:44:14 -05:00 committed by GitHub
commit db27fc910a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -195,7 +195,6 @@ local function updateController(controller: Controller, humanoid: Humanoid?)
BUTTON_FEED[Buttons.A_BUTTON] = Enum.UserInputState.End BUTTON_FEED[Buttons.A_BUTTON] = Enum.UserInputState.End
end end
local character = humanoid.Parent
local lastButtonValue = controller.ButtonDown() local lastButtonValue = controller.ButtonDown()
for button, state in pairs(BUTTON_FEED) do for button, state in pairs(BUTTON_FEED) do
@ -206,20 +205,18 @@ local function updateController(controller: Controller, humanoid: Humanoid?)
end end
end end
local buttonValue = controller.ButtonDown()
controller.ButtonPressed:Set(buttonValue)
table.clear(BUTTON_FEED) table.clear(BUTTON_FEED)
if character and character:GetAttribute("TAS") then local buttonValue = controller.ButtonDown()
return controller.ButtonPressed:Set(buttonValue)
end controller.ButtonPressed:Band(bit32.bxor(buttonValue, lastButtonValue))
if Core:GetAttribute("ToolAssistedInput") then local character = humanoid.Parent
return if (character and character:GetAttribute("TAS")) or Core:GetAttribute("ToolAssistedInput") then
if controller.ButtonDown:Has(Buttons.A_BUTTON) then
controller.ButtonPressed:Set(Buttons.A_BUTTON)
end
end end
local diff = bit32.bxor(buttonValue, lastButtonValue)
controller.ButtonPressed:Band(diff)
end end
ContextActionService:BindAction("MarioDebug", processAction, false, Enum.KeyCode.P) ContextActionService:BindAction("MarioDebug", processAction, false, Enum.KeyCode.P)