isaacscript-common 5.1.4 → 5.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,10 +13,10 @@ import { Keyboard } from "isaac-typescript-definitions";
13
13
  * @param triggerFunc A function containing the arbitrary code that you want to execute when the
14
14
  * hotkey is triggered.
15
15
  */
16
- export declare function registerHotkey(keyboardOrFunc: Keyboard | (() => Keyboard), triggerFunc: () => void): void;
16
+ export declare function registerHotkey(keyboardOrFunc: Keyboard | (() => Keyboard | undefined), triggerFunc: () => void): void;
17
17
  /**
18
18
  * Helper function to remove a hotkey created with the `registerHotkey` function.
19
19
  *
20
20
  * @param keyboardOrFunc Equal to the value that you passed when initially registering the hotkey.
21
21
  */
22
- export declare function unregisterHotkey(keyboardOrFunc: Keyboard | (() => Keyboard)): void;
22
+ export declare function unregisterHotkey(keyboardOrFunc: Keyboard | (() => Keyboard | undefined)): void;
@@ -25,7 +25,9 @@ function postRender(self)
25
25
  local keyboardFunc = ____value[1]
26
26
  local triggerFunc = ____value[2]
27
27
  local keyboard = keyboardFunc(nil)
28
- checkIfTriggered(nil, keyboard, triggerFunc)
28
+ if keyboard ~= nil then
29
+ checkIfTriggered(nil, keyboard, triggerFunc)
30
+ end
29
31
  end
30
32
  end
31
33
  function checkIfTriggered(self, keyboard, triggerFunc)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "5.1.4",
3
+ "version": "5.1.5",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",