I dunno how this event fires in cells that don't

have a waterlevel, but I saw a nil compare error in the logs at the line
if headHeight <= waterLevel, so I put this "or 0"
This commit is contained in:
Lilian Jónsdóttir 2021-08-17 23:47:10 -07:00
parent 9d61422cdc
commit 5fac128932

View file

@ -116,7 +116,7 @@ local function sinkInWater(e)
local mobile = e.mobile local mobile = e.mobile
local ref = e.reference local ref = e.reference
local actor = ref.object local actor = ref.object
local waterLevel = mobile.cell.waterLevel local waterLevel = mobile.cell.waterLevel or 0
local headHeight = mobile.position.z + mobile.height * 0.8 local headHeight = mobile.position.z + mobile.height * 0.8
-- no creatures -- no creatures