isaacscript-common 1.2.170 → 1.2.171
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.
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
2
|
local ____exports = {}
|
|
3
|
-
local hasSubscriptions, postNewRoom, preEntitySpawn, checkRoomChanged, currentRoomTopLeftWallPtrHash
|
|
3
|
+
local hasSubscriptions, postNewRoom, preEntitySpawn, checkRoomChanged, currentRoomTopLeftWallPtrHash, currentRoomTopLeftWallPtrHash2
|
|
4
4
|
local ____cachedClasses = require("cachedClasses")
|
|
5
5
|
local game = ____cachedClasses.game
|
|
6
6
|
local ____gridEntity = require("functions.gridEntity")
|
|
7
7
|
local getTopLeftWallGridIndex = ____gridEntity.getTopLeftWallGridIndex
|
|
8
8
|
local spawnGridEntity = ____gridEntity.spawnGridEntity
|
|
9
|
+
local ____log = require("functions.log")
|
|
10
|
+
local log = ____log.log
|
|
9
11
|
local ____postNewRoomEarly = require("callbacks.subscriptions.postNewRoomEarly")
|
|
10
12
|
local postNewRoomEarlyFire = ____postNewRoomEarly.postNewRoomEarlyFire
|
|
11
13
|
local postNewRoomEarlyHasSubscriptions = ____postNewRoomEarly.postNewRoomEarlyHasSubscriptions
|
|
@@ -31,16 +33,31 @@ function checkRoomChanged(self)
|
|
|
31
33
|
if topLeftWall == nil then
|
|
32
34
|
topLeftWall = spawnGridEntity(nil, GridEntityType.GRID_WALL, topLeftWallGridIndex)
|
|
33
35
|
if topLeftWall == nil then
|
|
36
|
+
log("Error: Failed to spawn a new wall (1) for the PostNewRoomEarly callback.")
|
|
34
37
|
return
|
|
35
38
|
end
|
|
39
|
+
log("Spawned a new wall (2) for the PostNewRoomEarly callback.")
|
|
40
|
+
end
|
|
41
|
+
local rightOfTopWallGridIndex = topLeftWallGridIndex + 1
|
|
42
|
+
local topLeftWall2 = room:GetGridEntity(rightOfTopWallGridIndex)
|
|
43
|
+
if topLeftWall2 == nil then
|
|
44
|
+
topLeftWall2 = spawnGridEntity(nil, GridEntityType.GRID_WALL, topLeftWallGridIndex)
|
|
45
|
+
if topLeftWall2 == nil then
|
|
46
|
+
log("Error: Failed to spawn a new wall (1) for the PostNewRoomEarly callback.")
|
|
47
|
+
return
|
|
48
|
+
end
|
|
49
|
+
log("Spawned a new wall (2) for the PostNewRoomEarly callback.")
|
|
36
50
|
end
|
|
37
51
|
local topLeftWallPtrHash = GetPtrHash(topLeftWall)
|
|
38
|
-
|
|
52
|
+
local topLeftWallPtrHash2 = GetPtrHash(topLeftWall2)
|
|
53
|
+
if topLeftWallPtrHash ~= currentRoomTopLeftWallPtrHash or topLeftWallPtrHash2 ~= currentRoomTopLeftWallPtrHash2 then
|
|
39
54
|
currentRoomTopLeftWallPtrHash = topLeftWallPtrHash
|
|
55
|
+
currentRoomTopLeftWallPtrHash2 = topLeftWallPtrHash2
|
|
40
56
|
postNewRoomEarlyFire(nil)
|
|
41
57
|
end
|
|
42
58
|
end
|
|
43
59
|
currentRoomTopLeftWallPtrHash = nil
|
|
60
|
+
currentRoomTopLeftWallPtrHash2 = nil
|
|
44
61
|
function ____exports.postNewRoomEarlyCallbackInit(self, mod)
|
|
45
62
|
mod:AddCallback(ModCallbacks.MC_POST_NEW_ROOM, postNewRoom)
|
|
46
63
|
mod:AddCallback(ModCallbacks.MC_PRE_ENTITY_SPAWN, preEntitySpawn)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.171",
|
|
4
4
|
"description": "Helper functions for IsaacScript mods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dist/**/*.d.ts"
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "^1.0.
|
|
28
|
+
"isaac-typescript-definitions": "^1.0.371",
|
|
29
29
|
"isaacscript-lint": "^1.0.91",
|
|
30
30
|
"isaacscript-tsconfig": "^1.1.8",
|
|
31
31
|
"typedoc": "^0.22.13",
|