api: default_vitals: Fix typo that led to early bailout

If `stand_node` was present, the first guard in `default_vitals`
bailed out.

This was seemingly unexpected and might be a relict from the
refactoring in 59602c9. There, a `not` got seemingly lost (from
line ~1260 in mob_meta.lua) and was not brought over properly to
api.lua.

We fix the guard to bail out only if at least one of `stand_pos`
or `stand_node` are missing. Noww, default_vitals actually does
its work again.

Fixes ElCeejo/animalia#99
Fixes ElCeejo/animalia#100
Fixes ElCeejo/animalia#78
This commit is contained in:
Christian Aistleitner 2024-11-16 15:16:41 +01:00
parent 24f997039f
commit 683d615742

View file

@ -396,7 +396,7 @@ end
function creatura.default_vitals(self) function creatura.default_vitals(self)
local pos = self.stand_pos local pos = self.stand_pos
local node = self.stand_node local node = self.stand_node
if not pos or node then return end if not pos or not node then return end
local max_fall = self.max_fall or 3 local max_fall = self.max_fall or 3
local in_liquid = self.in_liquid local in_liquid = self.in_liquid