More burning HUD fixes (kabou) #2076

Merged
cora merged 3 commits from fix-burning-hud into master 2022-03-18 11:52:09 +01:00
Contributor

This is a copy of #2072 with fixed branch.

Some further minor fixes to the fire HUD:

  1. Preempt possible crash on nil in on_joinplayer.
  • In mineclone5 a crash was reported to occur when deserialization of storage returned nil in on_joinplayer. 96c4fb60d8
    This commit uses a different, but equally effective fix.
  1. Minor changes to mcl_burning.
  • Remove animation_frame from fire entity state, it is now kept in the storage table of the parent entity.
  • Rename animation_timer in fire entity table to _mcl_animation_timer, in line with mineclone2 policy on adding custom members to minetest tables.
  • Comment out code that does nothing sensible. Scheduled for deletion at a later time.
  1. Remove unused code.
  • Remove code that tried to find fire luaentities in the same spot as the newly created fire luaentity. It may have been intended to optimize getting set on fire multiple times, but it makes no sense as it does not discriminate between fire luaentities attached to the object set on fire and those attached to other objects. The function that this code was in also has a better way to prevent adding multiple fire luaentities in the first place.

I did consider adapting ac1ec1d77d which is a fix for the on_joinplayer() / connected_players() mismatch conundrum. Since these problems are potentially all over the map and a more general solution is discussed in mineclonia in Mineclonia/Mineclonia#269 and Mineclonia/Mineclonia#278 I will leave it at that.

This is a copy of #2072 with fixed branch. Some further minor fixes to the fire HUD: 1. Preempt possible crash on nil in on_joinplayer. * In mineclone5 a crash was reported to occur when deserialization of storage returned nil in on_joinplayer. https://git.minetest.land/MineClone5/MineClone5/commit/96c4fb60d8641b4181edb902ed24dbf173828d09 This commit uses a different, but equally effective fix. 2. Minor changes to mcl_burning. * Remove animation_frame from fire entity state, it is now kept in the storage table of the parent entity. * Rename animation_timer in fire entity table to _mcl_animation_timer, in line with mineclone2 policy on adding custom members to minetest tables. * Comment out code that does nothing sensible. Scheduled for deletion at a later time. 3. Remove unused code. * Remove code that tried to find fire luaentities in the same spot as the newly created fire luaentity. It may have been intended to optimize getting set on fire multiple times, but it makes no sense as it does not discriminate between fire luaentities attached to the object set on fire and those attached to other objects. The function that this code was in also has a better way to prevent adding multiple fire luaentities in the first place. I did consider adapting https://git.minetest.land/MineClone5/MineClone5/commit/ac1ec1d77d40a3eb1f6c6b2e76ad114db46c43eb which is a fix for the on_joinplayer() / connected_players() mismatch conundrum. Since these problems are potentially all over the map and a more general solution is discussed in mineclonia in https://git.minetest.land/Mineclonia/Mineclonia/issues/269 and https://git.minetest.land/Mineclonia/Mineclonia/pulls/278 I will leave it at that.
cora added 3 commits 2022-03-18 11:44:12 +01:00
e9ff2ba32a Minor changes to mcl_burning.
* Remove animation_frame from fire entity state, it is now kept in the
  storage table of the parent entity.
* Rename animation_timer in fire entity table to _mcl_animation_timer,
  in line with mineclone2 policy on adding custom members to minetest
  tables.
* Comment out code that does nothing sensible.  Scheduled for deletion
  at a later time.
90311da514 Preempt possible crash on nil in on_joinplayer.
* In mineclone5 a crash was reported to occur when deserialization of
  storage returned nil in on_joinplayer.    https://git.minetest.land/
  MineClone5/MineClone5/commit/96c4fb60d8641b4181edb902ed24dbf173828d09
  This commit uses a different, but equally effective fix.
9eba0e4860 Remove unused code.
* Remove unused code that was commented out.  The code tried to find
  fire luaentities in the same spot as the newly created fire luaentity.
  It may have been intended to optimize getting set on fire multiple
  times, but it makes no sense as it does not discriminate between fire
  luaentities attached to the object set on fire and those attached to
  other objects.  The function that this code was in also has a better
  way to prevent adding multiple fire luaentities in the first place.
cora merged commit 81a1b9973a into master 2022-03-18 11:52:09 +01:00
cora deleted branch fix-burning-hud 2022-03-18 11:52:14 +01:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: VoxeLibre/VoxeLibre#2076
No description provided.