isaacscript-common 12.3.6 → 12.3.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "12.3.6",
3
+ "version": "12.3.7",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -9,6 +9,7 @@ import {
9
9
  ItemType,
10
10
  PickupPrice,
11
11
  PickupVariant,
12
+ RenderMode,
12
13
  RoomType,
13
14
  } from "isaac-typescript-definitions";
14
15
  import { game, itemConfig } from "../core/cachedClasses";
@@ -408,7 +409,12 @@ export function isActiveCollectible(collectibleType: CollectibleType): boolean {
408
409
  return itemType === ItemType.ACTIVE;
409
410
  }
410
411
 
411
- /** Returns true if the collectible has a red question mark sprite. */
412
+ /**
413
+ * Returns true if the collectible has a red question mark sprite.
414
+ *
415
+ * Note that this function will not work properly in a render callback with the `RenderMode` set to
416
+ * `RenderMode.WATER_REFLECT`. If this is detected, this function will throw a run-time error.
417
+ */
412
418
  export function isBlindCollectible(collectible: EntityPickup): boolean {
413
419
  if (!isCollectible(collectible)) {
414
420
  const entityID = getEntityID(collectible);
@@ -417,6 +423,14 @@ export function isBlindCollectible(collectible: EntityPickup): boolean {
417
423
  );
418
424
  }
419
425
 
426
+ const room = game.GetRoom();
427
+ const renderMode = room.GetRenderMode();
428
+ if (renderMode === RenderMode.WATER_REFLECT) {
429
+ error(
430
+ 'The "isBlindCollectible" function will not work properly in a render callback with the render mode equal to "RenderMode.WATER_REFLECT". Make sure that you properly account for this case if you are calling this function in a render callback.',
431
+ );
432
+ }
433
+
420
434
  const sprite = collectible.GetSprite();
421
435
  const animation = sprite.GetAnimation();
422
436
  const frame = sprite.GetFrame();