diff --git a/Makefile b/Makefile index 17d8471..814d101 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ PACKAGE_NAME := Misanthrope -VERSION_STRING := 0.3.5 +VERSION_STRING := 0.3.6 OUTPUT_NAME := $(PACKAGE_NAME)_$(VERSION_STRING) OUTPUT_DIR := build/$(OUTPUT_NAME) diff --git a/libs/region/biter_scents.lua b/libs/region/biter_scents.lua index 2ee9cba..80955da 100644 --- a/libs/region/biter_scents.lua +++ b/libs/region/biter_scents.lua @@ -121,10 +121,12 @@ function biter_scents.tick(cache) end function biter_scents.get_value(cache, x, y) - local x_idx = bit32.band(x, 0x7F) - local y_idx = bit32.band(y, 0x7F) - if cache.values[x_idx] and cache.values[x_idx][y_idx] then - return cache.values[x_idx][y_idx] + if cache and cache.values then + local x_idx = bit32.band(x, 0x7F) + local y_idx = bit32.band(y, 0x7F) + if cache.values[x_idx] and cache.values[x_idx][y_idx] then + return cache.values[x_idx][y_idx] + end end return 0 end