Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RedRafe committed Oct 20, 2024
1 parent 6ce3d01 commit 9582e6c
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion map_gen/maps/april_fools/scenario/entity-restrictions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ local function on_built(event)

entity.destroy()

local stack = event.stack or event.consumed_items.get_contents()[1]
local stack = event.stack or event.consumed_items.get_contents()[1] -- TODO: proper handle of consumed_items as LuaInventory
local player = game.get_player(event.player_index or 'none')
local robot = event.robot
if player and player.valid and not ghost and stack.valid then
Expand Down
2 changes: 1 addition & 1 deletion map_gen/maps/crash_site/scenario.lua
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ local function init(config)
price = 100,
name = 'simple-entity-with-owner',
name_label = 'Train Immunity (1x use)',
description = 'Each player port in your inventory will save you from being killed by a train once.'
description = 'Each train immunity item in your inventory will save you from being killed by a train once.'
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions map_gen/shared/entity_placement_restriction.lua
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ local on_built_token =

local index = event.player_index

local stack = event.consumed_items.get_contents()[1]
local stack = event.consumed_items.get_contents()[1] -- TODO: proper handle of consumed_items as LuaInventory
raise_event(
Public.events.on_pre_restricted_entity_destroyed,
{
Expand All @@ -225,7 +225,7 @@ local on_built_token =
}
)

local player = game.get_player(index)
local player = game.get_player(index or 'none')

-- Need to revalidate the entity since we sent it to the raised event
if entity.valid then
Expand Down
3 changes: 0 additions & 3 deletions utils/global.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
local Event = require 'utils.event_core'
local Token = require 'utils.token'

--local matching_path = '^.+/currently%-playing/(.+)$'
local matching_path = '^.+__level__/(.+)$'

local Global = {}
Expand Down Expand Up @@ -50,10 +49,8 @@ if _DEBUG then
Global.names = names

function Global.register(tbl, callback)
log(debug.getinfo(2, 'S').source)
local filepath = debug.getinfo(2, 'S').source:match(matching_path):sub(1, -5)
local token = Token.register_global(tbl)
log(filepath)

names[token] = concat {token, ' - ', filepath}

Expand Down
1 change: 0 additions & 1 deletion utils/gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ if _DEBUG then
local names = {}
Gui.names = names

--local matching_path = '^.+/currently%-playing/(.+)$'
local matching_path = '^.+__level__/(.+)$'

function Gui.uid_name()
Expand Down

0 comments on commit 9582e6c

Please sign in to comment.