Skip to content

Commit

Permalink
Minor refac, rem trailing space, shorten one line
Browse files Browse the repository at this point in the history
  • Loading branch information
TheHorscht committed May 11, 2023
1 parent 34e2944 commit 2c93af2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions EZWand.lua
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ local function render_tooltip(origin_x, origin_y, wand, gui_)
spell_lookup = {}
dofile_once("data/scripts/gun/gun_actions.lua")
for i, action in ipairs(actions) do
spell_lookup[action.id] = {
spell_lookup[action.id] = {
icon = action.sprite,
type = action.type
}
Expand Down Expand Up @@ -446,7 +446,7 @@ local function render_tooltip(origin_x, origin_y, wand, gui_)
end
local item_bg_icon = get_spell_bg(spell)
local w, h = GuiGetImageDimensions(gui, item_bg_icon, background_scale)
local x, y
local x, y
if i == 1 then
x, y = ac_icon_x + ac_icon_width + 3, math.floor(ac_icon_y - ac_icon_height / 2 + 2)
else
Expand Down Expand Up @@ -854,8 +854,7 @@ function wand:GetSpells()
local permanent = false
local item_action_component = EntityGetFirstComponentIncludingDisabled(spell, "ItemActionComponent")
if item_action_component then
local val = ComponentGetValue2(item_action_component, "action_id")
action_id = val
action_id = ComponentGetValue2(item_action_component, "action_id")
end
local inventory_x, inventory_y = -1, -1
local item_component = EntityGetFirstComponentIncludingDisabled(spell, "ItemComponent")
Expand Down Expand Up @@ -1058,7 +1057,7 @@ function wand:PlaceAt(x, y)
EntitySetComponentIsEnabled(self.entity_id, sprite_component, true)
local light_component = EntityGetFirstComponentIncludingDisabled(self.entity_id, "LightComponent")
EntitySetComponentIsEnabled(self.entity_id, light_component, true)

ComponentSetValue(item_component, "has_been_picked_by_player", "0")
ComponentSetValue(item_component, "play_hover_animation", "1")
ComponentSetValueVector2(item_component, "spawn_pos", x, y)
Expand Down

0 comments on commit 2c93af2

Please sign in to comment.