isaacscript-common 84.2.3 → 84.2.4

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.
@@ -94,7 +94,7 @@ exports.doesEntityExist = doesEntityExist;
94
94
  */
95
95
  function getClosestEntityTo(referenceEntity, entities, filterFunc) {
96
96
  let closestEntity;
97
- let closestDistance = math.huge;
97
+ let closestDistance = Number.POSITIVE_INFINITY;
98
98
  for (const entity of entities) {
99
99
  const distance = referenceEntity.Position.Distance(entity.Position);
100
100
  if (distance < closestDistance &&
@@ -95,7 +95,7 @@ exports.getCharacters = getCharacters;
95
95
  */
96
96
  function getClosestPlayer(position) {
97
97
  let closestPlayer;
98
- let closestDistance = math.huge;
98
+ let closestDistance = Number.POSITIVE_INFINITY;
99
99
  for (const player of (0, playerIndex_1.getPlayers)()) {
100
100
  const distance = position.Distance(player.Position);
101
101
  if (distance < closestDistance) {
@@ -125,7 +125,7 @@ exports.getFinalPlayer = getFinalPlayer;
125
125
  */
126
126
  function getNewestPlayer() {
127
127
  let newestPlayer;
128
- let lowestFrame = math.huge;
128
+ let lowestFrame = Number.POSITIVE_INFINITY;
129
129
  for (const player of (0, playerIndex_1.getPlayers)()) {
130
130
  if (player.FrameCount < lowestFrame) {
131
131
  newestPlayer = player;
@@ -57,7 +57,7 @@ exports.doesVectorHaveLength = doesVectorHaveLength;
57
57
  */
58
58
  function getClosestVectorTo(referenceVector, vectors) {
59
59
  let closestVector;
60
- let closestDistance = math.huge;
60
+ let closestDistance = Number.POSITIVE_INFINITY;
61
61
  for (const vector of vectors) {
62
62
  const distance = referenceVector.Distance(vector);
63
63
  if (distance < closestDistance) {
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 84.2.2
3
+ isaacscript-common 84.2.3
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "84.2.3",
3
+ "version": "84.2.4",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -144,7 +144,7 @@ export function getClosestEntityTo<T extends AnyEntity>(
144
144
  filterFunc?: (entity: T) => boolean,
145
145
  ): T | undefined {
146
146
  let closestEntity: T | undefined;
147
- let closestDistance = math.huge;
147
+ let closestDistance = Number.POSITIVE_INFINITY;
148
148
  for (const entity of entities) {
149
149
  const distance = referenceEntity.Position.Distance(entity.Position);
150
150
 
@@ -116,7 +116,7 @@ export function getCharacters(): readonly PlayerType[] {
116
116
  */
117
117
  export function getClosestPlayer(position: Vector): EntityPlayer {
118
118
  let closestPlayer: EntityPlayer | undefined;
119
- let closestDistance = math.huge;
119
+ let closestDistance = Number.POSITIVE_INFINITY;
120
120
  for (const player of getPlayers()) {
121
121
  const distance = position.Distance(player.Position);
122
122
 
@@ -154,7 +154,7 @@ export function getFinalPlayer(): EntityPlayer {
154
154
  */
155
155
  export function getNewestPlayer(): EntityPlayer {
156
156
  let newestPlayer: EntityPlayer | undefined;
157
- let lowestFrame = math.huge;
157
+ let lowestFrame = Number.POSITIVE_INFINITY;
158
158
  for (const player of getPlayers()) {
159
159
  if (player.FrameCount < lowestFrame) {
160
160
  newestPlayer = player;
@@ -89,7 +89,7 @@ export function getClosestVectorTo(
89
89
  vectors: readonly Vector[],
90
90
  ): Vector | undefined {
91
91
  let closestVector: Vector | undefined;
92
- let closestDistance = math.huge;
92
+ let closestDistance = Number.POSITIVE_INFINITY;
93
93
  for (const vector of vectors) {
94
94
  const distance = referenceVector.Distance(vector);
95
95