[5.6][boats] fix unsafe entity handling

this probably does not affect normal gameplay, unless you can set boats on fire somehow
This commit is contained in:
iliekprogrammar 2022-08-07 12:09:12 +08:00
parent bce4d29737
commit 4b31692319
No known key found for this signature in database
GPG Key ID: 8E7B20514DBCFBFA
1 changed files with 2 additions and 1 deletions

View File

@ -201,8 +201,9 @@ function boat.on_punch(self, puncher, time_from_last_punch, tool_capabilities, d
end end
function boat.on_step(self, dtime, moveresult) function boat.on_step(self, dtime, moveresult)
-- ERROR: [#2523] THIS WILL CAUSE INVALID OBJECTREFS
mcl_burning.tick(self.object, dtime, self) mcl_burning.tick(self.object, dtime, self)
-- mcl_burning.tick may remove object immediately
if not self.object:get_pos() then return end
self._v = get_v(self.object:get_velocity()) * get_sign(self._v) self._v = get_v(self.object:get_velocity()) * get_sign(self._v)
local v_factor = 1 local v_factor = 1