isaacscript-common 20.11.4 → 20.11.6

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/dist/index.d.ts CHANGED
@@ -2514,7 +2514,7 @@ declare class CustomTrapdoors extends Feature {
2514
2514
  * Inside this function, use the `setStage` or `setCustomStage` helper
2515
2515
  * functions, or do something completely custom.
2516
2516
  */
2517
- registerCustomTrapdoorDestination(destinationName: string, destinationFunc: (destinationStage: LevelStage, destinationStageType: StageType) => void): void;
2517
+ registerCustomTrapdoorDestination(destinationName: string, destinationFunc: (destinationName: string | undefined, destinationStage: LevelStage, destinationStageType: StageType) => void): void;
2518
2518
  /**
2519
2519
  * Helper function to spawn a trapdoor grid entity that will take a player to a vanilla stage or
2520
2520
  * custom location.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 20.11.4
3
+ isaacscript-common 20.11.6
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -39233,6 +39233,8 @@ local ____DefaultMap = require("src.classes.DefaultMap")
39233
39233
  local DefaultMap = ____DefaultMap.DefaultMap
39234
39234
  local ____Feature = require("src.classes.private.Feature")
39235
39235
  local Feature = ____Feature.Feature
39236
+ local ____constants = require("src.classes.features.other.customStages.constants")
39237
+ local CUSTOM_FLOOR_STAGE = ____constants.CUSTOM_FLOOR_STAGE
39236
39238
  function anyPlayerPlayingExtraAnimation(self)
39237
39239
  local players = getAllPlayers(nil)
39238
39240
  return __TS__ArraySome(
@@ -39271,7 +39273,7 @@ function dropTaintedForgotten(self, player)
39271
39273
  end
39272
39274
  end
39273
39275
  end
39274
- function goToVanillaStage(self, destinationStage, destinationStageType)
39276
+ function goToVanillaStage(self, _destinationName, destinationStage, destinationStageType)
39275
39277
  setStage(nil, destinationStage, destinationStageType)
39276
39278
  end
39277
39279
  local DEBUG = false
@@ -39386,7 +39388,7 @@ function CustomTrapdoors.prototype.goToCustomTrapdoorDestination(self)
39386
39388
  }
39387
39389
  end
39388
39390
  local destinationFunc = self:getDestinationFunc(self.v.run.customTrapdoorActivated)
39389
- destinationFunc(nil, self.v.run.customTrapdoorActivated.destinationStage, self.v.run.customTrapdoorActivated.destinationStageType)
39391
+ destinationFunc(nil, self.v.run.customTrapdoorActivated.destinationName, self.v.run.customTrapdoorActivated.destinationStage, self.v.run.customTrapdoorActivated.destinationStageType)
39390
39392
  end
39391
39393
  function CustomTrapdoors.prototype.getDestinationFunc(self, customTrapdoorDescription)
39392
39394
  if customTrapdoorDescription.destinationName == nil then
@@ -39420,6 +39422,11 @@ function CustomTrapdoors.prototype.checkSecondPixelationHalfWay(self)
39420
39422
  player.EntityCollisionClass = EntityCollisionClass.ALL
39421
39423
  player.GridCollisionClass = EntityGridCollisionClass.GROUND
39422
39424
  end
39425
+ local level = game:GetLevel()
39426
+ local stage = level:GetStage()
39427
+ if stage ~= CUSTOM_FLOOR_STAGE then
39428
+ level:ShowName(false)
39429
+ end
39423
39430
  end)
39424
39431
  end
39425
39432
  function CustomTrapdoors.prototype.checkAllPlayersLayingDownComplete(self)
@@ -39483,14 +39490,14 @@ function CustomTrapdoors.prototype.checkCustomTrapdoorPlayerTouched(self, gridEn
39483
39490
  do
39484
39491
  local player = playerEntity:ToPlayer()
39485
39492
  if player == nil then
39486
- goto __continue42
39493
+ goto __continue43
39487
39494
  end
39488
39495
  if not self.ponyDetection:isPlayerUsingPony(player) and not isChildPlayer(nil, player) and canPlayerInteractWithTrapdoor(nil, player) then
39489
39496
  self:playerTouchedCustomTrapdoor(gridEntity, trapdoorDescription, player)
39490
39497
  return
39491
39498
  end
39492
39499
  end
39493
- ::__continue42::
39500
+ ::__continue43::
39494
39501
  end
39495
39502
  end
39496
39503
  function CustomTrapdoors.prototype.playerTouchedCustomTrapdoor(self, gridEntity, trapdoorDescription, player)
@@ -42280,9 +42287,12 @@ function CustomStages.prototype.____constructor(self, customGridEntities, custom
42280
42287
  }}
42281
42288
  self.customStagesMap = __TS__New(Map)
42282
42289
  self.customStageCachedRoomData = __TS__New(Map)
42283
- self.goToCustomStage = function(____, destinationStage, _destinationStageType)
42290
+ self.goToCustomStage = function(____, destinationName, destinationStage, _destinationStageType)
42291
+ if destinationName == nil then
42292
+ error("Failed to go to a custom stage since the custom trapdoors feature did not pass a destination name to the logic function.")
42293
+ end
42284
42294
  local firstFloor = destinationStage == LevelStage.BASEMENT_1
42285
- self:setCustomStage("Slaughterhouse", firstFloor)
42295
+ self:setCustomStage(destinationName, firstFloor)
42286
42296
  end
42287
42297
  self.postRender = function()
42288
42298
  local customStage = self.v.run.currentCustomStage
@@ -42398,10 +42408,10 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
42398
42408
  for ____, room in ipairs(getRoomsInsideGrid(nil)) do
42399
42409
  do
42400
42410
  if room.SafeGridIndex == startingRoomGridIndex then
42401
- goto __continue26
42411
+ goto __continue27
42402
42412
  end
42403
42413
  if room.Data == nil then
42404
- goto __continue26
42414
+ goto __continue27
42405
42415
  end
42406
42416
  local roomType = room.Data.Type
42407
42417
  local roomShapeMap = customStage.roomTypeMap:get(roomType)
@@ -42412,7 +42422,7 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
42412
42422
  (((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") for custom stage: ") .. customStage.name
42413
42423
  )
42414
42424
  end
42415
- goto __continue26
42425
+ goto __continue27
42416
42426
  end
42417
42427
  local roomShape = room.Data.Shape
42418
42428
  local roomDoorSlotFlagMap = roomShapeMap:get(roomShape)
@@ -42421,7 +42431,7 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
42421
42431
  nil,
42422
42432
  (((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") for custom stage: ") .. customStage.name
42423
42433
  )
42424
- goto __continue26
42434
+ goto __continue27
42425
42435
  end
42426
42436
  local doorSlotFlags = room.Data.Doors
42427
42437
  local roomsMetadata = roomDoorSlotFlagMap:get(doorSlotFlags)
@@ -42434,13 +42444,13 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
42434
42444
  nil,
42435
42445
  (((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") + all doors enabled for custom stage: ") .. customStage.name
42436
42446
  )
42437
- goto __continue26
42447
+ goto __continue27
42438
42448
  end
42439
42449
  end
42440
42450
  local randomRoom
42441
42451
  if roomType == RoomType.BOSS then
42442
42452
  if customStage.bossPool == nil then
42443
- goto __continue26
42453
+ goto __continue27
42444
42454
  end
42445
42455
  randomRoom = getRandomBossRoomFromPool(
42446
42456
  nil,
@@ -42460,13 +42470,13 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
42460
42470
  nil,
42461
42471
  (("Failed to get the room data for room variant " .. tostring(randomRoom.variant)) .. " for custom stage: ") .. customStage.name
42462
42472
  )
42463
- goto __continue26
42473
+ goto __continue27
42464
42474
  end
42465
42475
  self.customStageCachedRoomData:set(randomRoom.variant, newRoomData)
42466
42476
  end
42467
42477
  room.Data = newRoomData
42468
42478
  end
42469
- ::__continue26::
42479
+ ::__continue27::
42470
42480
  end
42471
42481
  end
42472
42482
  function CustomStages.prototype.setCustomStage(self, name, firstFloor, streakText, verbose)
@@ -1 +1 @@
1
- {"version":3,"file":"CustomStages.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/CustomStages.ts"],"names":[],"mappings":"AAwCA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAoChD,qBAAa,YAAa,SAAQ,OAAO;IA8BvC,oCAAoC;IACpC,OAAO,CAAC,eAAe,CAAkC;IAEzD,+BAA+B;IAC/B,OAAO,CAAC,yBAAyB,CAAwC;IAEzE,OAAO,CAAC,k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IASvB,OAAO,CAAC,6BAA6B;IAOrC,OAAO,CAAC,eAAe,CAarB;IAGF,OAAO,CAAC,UAAU,CAQhB;IAGF,OAAO,CAAC,aAAa,CAcnB;IAGF,OAAO,CAAC,eAAe,CAUrB;IAIF,OAAO,CAAC,2BAA2B,CAejC;IAGF,OAAO,CAAC,kBAAkB,CAqBxB;IAGF,OAAO,CAAC,oBAAoB,CAe1B;IAEF,gDAAgD;IAChD,OAAO,CAAC,iBAAiB;IA+FzB;;;;;;;;;;;;;;;;OAgBG;IAEI,cAAc,CACnB,IAAI,EAAE,MAAM,EACZ,UAAU,UAAO,EACjB,UAAU,UAAO,EACjB,OAAO,UAAQ,GACd,IAAI;IAoEP;;;;;OAKG;IAEI,kBAAkB,IAAI,IAAI;CAGlC"}
@@ -116,9 +116,12 @@ function CustomStages.prototype.____constructor(self, customGridEntities, custom
116
116
  }}
117
117
  self.customStagesMap = __TS__New(Map)
118
118
  self.customStageCachedRoomData = __TS__New(Map)
119
- self.goToCustomStage = function(____, destinationStage, _destinationStageType)
119
+ self.goToCustomStage = function(____, destinationName, destinationStage, _destinationStageType)
120
+ if destinationName == nil then
121
+ error("Failed to go to a custom stage since the custom trapdoors feature did not pass a destination name to the logic function.")
122
+ end
120
123
  local firstFloor = destinationStage == LevelStage.BASEMENT_1
121
- self:setCustomStage("Slaughterhouse", firstFloor)
124
+ self:setCustomStage(destinationName, firstFloor)
122
125
  end
123
126
  self.postRender = function()
124
127
  local customStage = self.v.run.currentCustomStage
@@ -234,10 +237,10 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
234
237
  for ____, room in ipairs(getRoomsInsideGrid(nil)) do
235
238
  do
236
239
  if room.SafeGridIndex == startingRoomGridIndex then
237
- goto __continue26
240
+ goto __continue27
238
241
  end
239
242
  if room.Data == nil then
240
- goto __continue26
243
+ goto __continue27
241
244
  end
242
245
  local roomType = room.Data.Type
243
246
  local roomShapeMap = customStage.roomTypeMap:get(roomType)
@@ -248,7 +251,7 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
248
251
  (((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") for custom stage: ") .. customStage.name
249
252
  )
250
253
  end
251
- goto __continue26
254
+ goto __continue27
252
255
  end
253
256
  local roomShape = room.Data.Shape
254
257
  local roomDoorSlotFlagMap = roomShapeMap:get(roomShape)
@@ -257,7 +260,7 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
257
260
  nil,
258
261
  (((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") for custom stage: ") .. customStage.name
259
262
  )
260
- goto __continue26
263
+ goto __continue27
261
264
  end
262
265
  local doorSlotFlags = room.Data.Doors
263
266
  local roomsMetadata = roomDoorSlotFlagMap:get(doorSlotFlags)
@@ -270,13 +273,13 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
270
273
  nil,
271
274
  (((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") + all doors enabled for custom stage: ") .. customStage.name
272
275
  )
273
- goto __continue26
276
+ goto __continue27
274
277
  end
275
278
  end
276
279
  local randomRoom
277
280
  if roomType == RoomType.BOSS then
278
281
  if customStage.bossPool == nil then
279
- goto __continue26
282
+ goto __continue27
280
283
  end
281
284
  randomRoom = getRandomBossRoomFromPool(
282
285
  nil,
@@ -296,13 +299,13 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
296
299
  nil,
297
300
  (("Failed to get the room data for room variant " .. tostring(randomRoom.variant)) .. " for custom stage: ") .. customStage.name
298
301
  )
299
- goto __continue26
302
+ goto __continue27
300
303
  end
301
304
  self.customStageCachedRoomData:set(randomRoom.variant, newRoomData)
302
305
  end
303
306
  room.Data = newRoomData
304
307
  end
305
- ::__continue26::
308
+ ::__continue27::
306
309
  end
307
310
  end
308
311
  function CustomStages.prototype.setCustomStage(self, name, firstFloor, streakText, verbose)
@@ -56,7 +56,7 @@ export declare class CustomTrapdoors extends Feature {
56
56
  * Inside this function, use the `setStage` or `setCustomStage` helper
57
57
  * functions, or do something completely custom.
58
58
  */
59
- registerCustomTrapdoorDestination(destinationName: string, destinationFunc: (destinationStage: LevelStage, destinationStageType: StageType) => void): void;
59
+ registerCustomTrapdoorDestination(destinationName: string, destinationFunc: (destinationName: string | undefined, destinationStage: LevelStage, destinationStageType: StageType) => void): void;
60
60
  /**
61
61
  * Helper function to spawn a trapdoor grid entity that will take a player to a vanilla stage or
62
62
  * custom location.
@@ -1 +1 @@
1
- {"version":3,"file":"CustomTrapdoors.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/CustomTrapdoors.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,UAAU,EAKV,SAAS,EACV,MAAM,8BAA8B,CAAC;AA6BtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AA+BhD,qBAAa,eAAgB,SAAQ,OAAO;IAC1C,qCAAqC;IACrC,OAAO,CAAC,kBAAkB,CAGtB;IAqBJ;;;;;OAKG;IACH,OAAO,CAAC,WAAW,CAAY;IAE/B,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,YAAY,CAAe;IAmDnC,OAAO,CAAC,UAAU,CAMhB;IAEF,OAAO,CAAC,2BAA2B;IA+BnC,OAAO,CAAC,8BAA8B;IAmDtC,OAAO,CAAC,6BAA6B;IAqBrC,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,4BAA4B;IAyCpC,OAAO,CAAC,iC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67,6 +67,8 @@ local ____DefaultMap = require("src.classes.DefaultMap")
67
67
  local DefaultMap = ____DefaultMap.DefaultMap
68
68
  local ____Feature = require("src.classes.private.Feature")
69
69
  local Feature = ____Feature.Feature
70
+ local ____constants = require("src.classes.features.other.customStages.constants")
71
+ local CUSTOM_FLOOR_STAGE = ____constants.CUSTOM_FLOOR_STAGE
70
72
  function anyPlayerPlayingExtraAnimation(self)
71
73
  local players = getAllPlayers(nil)
72
74
  return __TS__ArraySome(
@@ -105,7 +107,7 @@ function dropTaintedForgotten(self, player)
105
107
  end
106
108
  end
107
109
  end
108
- function goToVanillaStage(self, destinationStage, destinationStageType)
110
+ function goToVanillaStage(self, _destinationName, destinationStage, destinationStageType)
109
111
  setStage(nil, destinationStage, destinationStageType)
110
112
  end
111
113
  local DEBUG = false
@@ -221,7 +223,7 @@ function CustomTrapdoors.prototype.goToCustomTrapdoorDestination(self)
221
223
  }
222
224
  end
223
225
  local destinationFunc = self:getDestinationFunc(self.v.run.customTrapdoorActivated)
224
- destinationFunc(nil, self.v.run.customTrapdoorActivated.destinationStage, self.v.run.customTrapdoorActivated.destinationStageType)
226
+ destinationFunc(nil, self.v.run.customTrapdoorActivated.destinationName, self.v.run.customTrapdoorActivated.destinationStage, self.v.run.customTrapdoorActivated.destinationStageType)
225
227
  end
226
228
  function CustomTrapdoors.prototype.getDestinationFunc(self, customTrapdoorDescription)
227
229
  if customTrapdoorDescription.destinationName == nil then
@@ -255,6 +257,11 @@ function CustomTrapdoors.prototype.checkSecondPixelationHalfWay(self)
255
257
  player.EntityCollisionClass = EntityCollisionClass.ALL
256
258
  player.GridCollisionClass = EntityGridCollisionClass.GROUND
257
259
  end
260
+ local level = game:GetLevel()
261
+ local stage = level:GetStage()
262
+ if stage ~= CUSTOM_FLOOR_STAGE then
263
+ level:ShowName(false)
264
+ end
258
265
  end)
259
266
  end
260
267
  function CustomTrapdoors.prototype.checkAllPlayersLayingDownComplete(self)
@@ -318,14 +325,14 @@ function CustomTrapdoors.prototype.checkCustomTrapdoorPlayerTouched(self, gridEn
318
325
  do
319
326
  local player = playerEntity:ToPlayer()
320
327
  if player == nil then
321
- goto __continue42
328
+ goto __continue43
322
329
  end
323
330
  if not self.ponyDetection:isPlayerUsingPony(player) and not isChildPlayer(nil, player) and canPlayerInteractWithTrapdoor(nil, player) then
324
331
  self:playerTouchedCustomTrapdoor(gridEntity, trapdoorDescription, player)
325
332
  return
326
333
  end
327
334
  end
328
- ::__continue42::
335
+ ::__continue43::
329
336
  end
330
337
  end
331
338
  function CustomTrapdoors.prototype.playerTouchedCustomTrapdoor(self, gridEntity, trapdoorDescription, player)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "20.11.4",
3
+ "version": "20.11.6",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -199,11 +199,18 @@ export class CustomStages extends Feature {
199
199
  }
200
200
 
201
201
  private goToCustomStage = (
202
+ destinationName: string | undefined,
202
203
  destinationStage: LevelStage,
203
204
  _destinationStageType: StageType,
204
205
  ) => {
206
+ if (destinationName === undefined) {
207
+ error(
208
+ "Failed to go to a custom stage since the custom trapdoors feature did not pass a destination name to the logic function.",
209
+ );
210
+ }
211
+
205
212
  const firstFloor = destinationStage === LevelStage.BASEMENT_1;
206
- this.setCustomStage("Slaughterhouse", firstFloor);
213
+ this.setCustomStage(destinationName, firstFloor);
207
214
  };
208
215
 
209
216
  // ModCallback.POST_RENDER (2)
@@ -42,6 +42,7 @@ import { CustomTrapdoorDescription } from "../../../interfaces/private/CustomTra
42
42
  import { DefaultMap } from "../../DefaultMap";
43
43
  import { Feature } from "../../private/Feature";
44
44
  import { CustomGridEntities } from "../callbackLogic/CustomGridEntities";
45
+ import { CUSTOM_FLOOR_STAGE } from "./customStages/constants";
45
46
  import { DisableInputs } from "./DisableInputs";
46
47
  import { PonyDetection } from "./PonyDetection";
47
48
  import { RoomClearFrame } from "./RoomClearFrame";
@@ -75,7 +76,11 @@ export class CustomTrapdoors extends Feature {
75
76
  /** Indexed by custom trapdoor ID. */
76
77
  private destinationFuncMap = new Map<
77
78
  string,
78
- (destinationStage: LevelStage, destinationStageType: StageType) => void
79
+ (
80
+ destinationName: string | undefined,
81
+ destinationStage: LevelStage,
82
+ destinationStageType: StageType,
83
+ ) => void
79
84
  >();
80
85
 
81
86
  /** @internal */
@@ -268,6 +273,7 @@ export class CustomTrapdoors extends Feature {
268
273
  this.v.run.customTrapdoorActivated,
269
274
  );
270
275
  destinationFunc(
276
+ this.v.run.customTrapdoorActivated.destinationName,
271
277
  this.v.run.customTrapdoorActivated.destinationStage,
272
278
  this.v.run.customTrapdoorActivated.destinationStageType,
273
279
  );
@@ -275,7 +281,11 @@ export class CustomTrapdoors extends Feature {
275
281
 
276
282
  private getDestinationFunc(
277
283
  customTrapdoorDescription: CustomTrapdoorDescription,
278
- ): (destinationStage: LevelStage, destinationStageType: StageType) => void {
284
+ ): (
285
+ destinationName: string | undefined,
286
+ destinationStage: LevelStage,
287
+ destinationStageType: StageType,
288
+ ) => void {
279
289
  if (customTrapdoorDescription.destinationName === undefined) {
280
290
  return goToVanillaStage;
281
291
  }
@@ -328,6 +338,12 @@ export class CustomTrapdoors extends Feature {
328
338
  player.EntityCollisionClass = EntityCollisionClass.ALL;
329
339
  player.GridCollisionClass = EntityGridCollisionClass.GROUND;
330
340
  }
341
+
342
+ const level = game.GetLevel();
343
+ const stage = level.GetStage();
344
+ if (stage !== CUSTOM_FLOOR_STAGE) {
345
+ level.ShowName(false);
346
+ }
331
347
  });
332
348
  }
333
349
 
@@ -663,6 +679,7 @@ export class CustomTrapdoors extends Feature {
663
679
  public registerCustomTrapdoorDestination(
664
680
  destinationName: string,
665
681
  destinationFunc: (
682
+ destinationName: string | undefined,
666
683
  destinationStage: LevelStage,
667
684
  destinationStageType: StageType,
668
685
  ) => void,
@@ -846,6 +863,7 @@ function dropTaintedForgotten(player: EntityPlayer) {
846
863
 
847
864
  /** The default `destinationFunc` for a custom trapdoor. */
848
865
  function goToVanillaStage(
866
+ _destinationName: string | undefined,
849
867
  destinationStage: LevelStage,
850
868
  destinationStageType: StageType,
851
869
  ) {