diff --git a/changelog.txt b/changelog.txt index 8e0c940..ccdc16c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,3 +3,9 @@ Version: 0.1.0 Date: 2020-08-14 Features: - Initial release: Adds shortcut to command a squad of spidertrons + +--------------------------------------------------------------------------------------------------- +Version: 0.1.1 +Date: 2020-08-15 + Bugfixes: + - Fixed issue clearing inventory of 'residual' remotes with non-god controllers (*Facepalm*) diff --git a/control.lua b/control.lua index cb56a82..fd555a9 100644 --- a/control.lua +++ b/control.lua @@ -83,8 +83,11 @@ script.on_event("squad-spidertron-remote", function(event) local player = game.players[event.player_index] local stack = {name="squad-spidertron-remote-sel",count=1} if player.clean_cursor() and player.cursor_stack.can_set_stack(stack) then - player.get_inventory(2).remove("squad-spidertron-remote-sel") - player.get_inventory(2).remove("squad-spidertron-remote") + if player.get_main_inventory() then + player.get_main_inventory().remove("squad-spidertron-remote-sel") + player.get_main_inventory().remove("squad-spidertron-remote") + end + player.cursor_stack.set_stack(stack) end end) \ No newline at end of file diff --git a/info.json b/info.json index 1241b84..4ea93e2 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "Spider_Control", - "version": "0.1.0", + "version": "0.1.1", "factorio_version": "1.0", "title": "Spidertron squad control", "author": "npc_strider(morley376)",