From 591577845f22a1220a84764c8848a90a807fa651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelina=20Ho=C5=82ub?= <86662980+154pinkchairs@users.noreply.github.com> Date: Wed, 27 Jul 2022 23:42:42 +0000 Subject: [PATCH] provde a self.view_range definition When it was nil, the mod would crash the game upon spawning cats and trying to play with them. --- api/behaviors.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/api/behaviors.lua b/api/behaviors.lua index 026f789..c00b836 100644 --- a/api/behaviors.lua +++ b/api/behaviors.lua @@ -1456,6 +1456,7 @@ creatura.register_utility("animalia:walk_ahead_of_player", function(self, player tpos.z = tpos.z + dir.z self.status = self:memorize("status", "following") local dist = vec_dist(pos, tpos) + self.view_range = math.abs(tpos.x) + 80 if dist > self.view_range then self.status = self:memorize("status", "") return true