isaacscript-common 1.0.584 → 1.0.585

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.
@@ -5,5 +5,9 @@
5
5
  * with heaven doors and partially overlap with players, if the thing being spawned is bigger than a
6
6
  * tile (like a Blood Donation Machine). Use this function instead if you want to account for those
7
7
  * specific situations.
8
+ *
9
+ * @param startingPosition The position to start searching from. If this position is not overlapping
10
+ * with anything, then it will be returned.
11
+ * @param avoidActiveEntities Optional. False by default.
8
12
  */
9
- export declare function findFreePosition(startingPosition: Vector): Vector;
13
+ export declare function findFreePosition(startingPosition: Vector, avoidActiveEntities?: boolean): Vector;
@@ -7,7 +7,10 @@ local anyEntityCloserThan = ____entity.anyEntityCloserThan
7
7
  local getEffects = ____entity.getEffects
8
8
  local ____player = require("functions.player")
9
9
  local getPlayerCloserThan = ____player.getPlayerCloserThan
10
- function ____exports.findFreePosition(self, startingPosition)
10
+ function ____exports.findFreePosition(self, startingPosition, avoidActiveEntities)
11
+ if avoidActiveEntities == nil then
12
+ avoidActiveEntities = false
13
+ end
11
14
  local game = Game()
12
15
  local room = game:GetRoom()
13
16
  local heavenDoors = getEffects(nil, EffectVariant.HEAVEN_LIGHT_DOOR, 0)
@@ -15,7 +18,7 @@ function ____exports.findFreePosition(self, startingPosition)
15
18
  local i = 0
16
19
  while i < 100 do
17
20
  do
18
- local position = room:FindFreePickupSpawnPosition(startingPosition, i)
21
+ local position = room:FindFreePickupSpawnPosition(startingPosition, i, avoidActiveEntities)
19
22
  local closePlayer = getPlayerCloserThan(nil, position, DISTANCE_OF_GRID_TILE)
20
23
  if closePlayer ~= nil then
21
24
  goto __continue3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.0.584",
3
+ "version": "1.0.585",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",