Skip to content

Commit

Permalink
Error when changing character icon #135
Browse files Browse the repository at this point in the history
  • Loading branch information
KiwiHawk committed Aug 7, 2023
1 parent ca4d9aa commit 65de916
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions bobclasses/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Version: 1.2.0
Date: ???
Changes:
- Added missing prerequisites #120
Bugfixes:
- Fixed error when changing character icon #135
---------------------------------------------------------------------------------------------------
Version: 1.1.5
Date: 06. 06. 2022
Expand Down
14 changes: 7 additions & 7 deletions bobclasses/control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,16 @@ function minime_exchanged_characters(event)

-- Switch to another character
if new_character and not (editor or god) then
wlog("Calling refresh_avatar_gui(" .. player_index .. ")!")
wlog("Calling refresh_avatar_gui(" .. player_index .. ")")
refresh_avatar_gui(player_index)

-- Enter editor mode
elseif editor then
wlog("Calling switch_to_editor(" .. player_index .. ", " .. tostring(old_character and old_character.name) .. ")!")
wlog("Calling switch_to_editor(" .. player_index .. ", " .. tostring(old_character and old_character.name) .. ")")
switch_to_editor(player_index, old_character)
-- Enter god mode
elseif god then
wlog("Calling switch_to_god(" .. player_index .. ", " .. tostring(old_character and old_character.name) .. ")!")
wlog("Calling switch_to_god(" .. player_index .. ", " .. tostring(old_character and old_character.name) .. ")")
switch_to_god(player_index, old_character)
end
end
Expand Down Expand Up @@ -1219,7 +1219,7 @@ function delete_minimap_gui(player_index)
end

function set_character_icon(player_index, entity)
wlog("Entered function set_character_icon(" .. player_index .. ", " .. entity.name(")!"))
wlog("Entered function set_character_icon(" .. player_index .. ", " .. entity.name .. ")")

local player = game.players[player_index]
local hand_item = nil
Expand Down Expand Up @@ -1252,7 +1252,7 @@ function reset_character_icon(entity)
end

function create_character(player_index, class)
wlog("Entered function create_character(" .. player_index .. ", " .. serpent.line(class) .. ")!")
wlog("Entered function create_character(" .. player_index .. ", " .. serpent.line(class) .. ")")
local player = game.players[player_index]

if player.controller_type == defines.controllers.character and player.character ~= nil and player.character.valid then
Expand Down Expand Up @@ -1342,7 +1342,7 @@ function create_character(player_index, class)
-- It seems that creating a character with fast_replace would destroy the old entity.
-- But there are situations where the old character may still be around and block the
-- new one. Make sure the old character is really removed!
--~ wlog("Removing old character \""..old.name.."\" ("..old.unit_number..")!")
--~ wlog("Removing old character \"" .. old.name .. "\" (" .. old.unit_number .. ")")
if old and old.valid then
wlog("Removing old character!")
old.destroy()
Expand Down Expand Up @@ -1419,7 +1419,7 @@ function switch_character(player_index, new_character)
.. player_index
.. ", "
.. tostring(new_character and new_character.name)
.. ")!"
.. ")"
)

local player = game.players[player_index]
Expand Down

0 comments on commit 65de916

Please sign in to comment.