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.
This commit is contained in:
Marcelina Hołub 2022-07-27 23:42:42 +00:00 committed by GitHub
parent 78e7b8bb44
commit 591577845f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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