Skip to content

Commit

Permalink
#12 should be the final fix (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasJurczok authored Jan 31, 2019
1 parent 6301a5a commit 502b292
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ You can monitor multiple entities at the same time and give them names to distin

## Changelog

### 16.1.1
### 16.1.2
- fix crash when other selection tools are used
- change ingredients to make it buildable without oil

Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "PowerMon",
"version": "16.1.1",
"version": "16.1.2",
"title": "Power Monitor",
"author": "Jason Miles, Tessiema",
"contact": "jonasjurczok+factorio@gmail.com",
Expand Down
6 changes: 5 additions & 1 deletion src/pmon/pmon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,11 @@ function pmon.on_player_selected_area(event)
local player = game.players[event.player_index]
local cursor_stack = player.cursor_stack

if (cursor_stack.valid and cursor_stack.name == "pmon-power-monitor") then
if ((not cursor_stack.valid) or (not cursor_stack.valid_for_read)) then
return
end

if (cursor_stack.name == "pmon-power-monitor") then
local entity = event.entities[1]

if (entity) then
Expand Down

0 comments on commit 502b292

Please sign in to comment.