From 683d6157427a187954d4086a01d5e0b324a5d203 Mon Sep 17 00:00:00 2001 From: Christian Aistleitner Date: Sat, 16 Nov 2024 15:16:41 +0100 Subject: [PATCH] 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 --- api.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.lua b/api.lua index e766322..1ea42de 100644 --- a/api.lua +++ b/api.lua @@ -396,7 +396,7 @@ end function creatura.default_vitals(self) local pos = self.stand_pos 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 in_liquid = self.in_liquid