Gistix / portal2vr

Portal 2 VR Mod
740 stars 19 forks source link

Fix compatibility to Portal Reloaded #136

Open stsichler opened 3 months ago

stsichler commented 3 months ago

In Portal Reloaded, a third (time) portal can be placed.

This patch adds another action ("ThirdAttack") for that, by default mapped to left trigger.

In order for this to work, it is also required to fix processing of digital inputs in general: The previous code (see PressedDigitalAction()) correctly sent "button pressed" events to the game when a button changed state from released to pressed, but re-sent "button released" events repeatedly at all time when the button was in released state. This is supposed to be a bug and somehow prevented the freshly added ThirdAttack action from being correctly processed by the game engine.

This PR also fixes this and thus closes issue #109.

Note that a short test showed that compatibility to Portal 2 (or Portal Stories: Mel) is unchanged by this PR.