mirror of
https://github.com/ElCeejo/animalia.git
synced 2025-04-30 05:21:40 -04:00
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:
parent
78e7b8bb44
commit
591577845f
1 changed files with 1 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue