isaacscript-common 1.2.157 → 1.2.158

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.
@@ -15,7 +15,7 @@ export declare function logAllDamageFlags(this: void, flags: int): void;
15
15
  /** Helper function for printing out every entity flag that is turned on. Useful when debugging. */
16
16
  export declare function logAllEntityFlags(this: void, flags: int): void;
17
17
  /** Helper function for printing out every flag that is turned on. Useful when debugging. */
18
- export declare function logAllFlags(this: void, flags: int, flagEnum: LuaTable, description?: string): void;
18
+ export declare function logAllFlags(this: void, flags: int, flagEnum?: LuaTable, description?: string): void;
19
19
  /**
20
20
  * Helper function for printing out every game state flag that is turned on. Useful when debugging.
21
21
  */
@@ -62,13 +62,29 @@ function ____exports.logAllFlags(flags, flagEnum, description)
62
62
  if description ~= "" then
63
63
  description = description .. " "
64
64
  end
65
- ____exports.log(("Logging all " .. description) .. "flags:")
65
+ if flagEnum == nil then
66
+ flagEnum = {}
67
+ do
68
+ local i = 0
69
+ while i <= 62 do
70
+ flagEnum["1 << " .. tostring(i)] = 1 << i
71
+ i = i + 1
72
+ end
73
+ end
74
+ end
75
+ ____exports.log(((("Logging all " .. description) .. "flags for value ") .. tostring(flags)) .. ":")
66
76
  local hasNoFlags = true
67
77
  for key, value in pairs(flagEnum) do
68
- if hasFlag(nil, flags, value) then
69
- ____exports.log((((" Has flag: " .. tostring(key)) .. " (") .. tostring(value)) .. ")")
70
- hasNoFlags = false
78
+ do
79
+ if type(value) ~= "number" then
80
+ goto __continue13
81
+ end
82
+ if hasFlag(nil, flags, value) then
83
+ ____exports.log((((" Has flag: " .. tostring(key)) .. " (") .. tostring(value)) .. ")")
84
+ hasNoFlags = false
85
+ end
71
86
  end
87
+ ::__continue13::
72
88
  end
73
89
  if hasNoFlags then
74
90
  ____exports.log(" n/a (no flags)")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.157",
3
+ "version": "1.2.158",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",