[5.6][bows] fix unsafe entity handling for arrows

This commit is contained in:
iliekprogrammar 2022-08-07 12:48:09 +08:00
parent 4f2789c498
commit 156aff21a1
No known key found for this signature in database
GPG Key ID: 8E7B20514DBCFBFA
2 changed files with 4 additions and 2 deletions

View File

@ -114,8 +114,9 @@ local function damage_particles(pos, is_critical)
end end
function ARROW_ENTITY.on_step(self, dtime) function ARROW_ENTITY.on_step(self, dtime)
-- 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._time_in_air = self._time_in_air + .001 self._time_in_air = self._time_in_air + .001

View File

@ -312,8 +312,9 @@ local function damage_particles(pos, is_critical)
end end
function ARROW_ENTITY.on_step(self, dtime) function ARROW_ENTITY.on_step(self, dtime)
-- 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._time_in_air = self._time_in_air + .001 self._time_in_air = self._time_in_air + .001