Fix - New game load crashes. Add defensive check. #4216
No reviewers
Labels
No Label
#P1 CRITICAL
#P2: HIGH
#P3: elevated
#P4 priority: medium
#P6: low
#Review
annoying
API
bug
code quality
combat
commands
compatibility
configurability
contribution inside
controls
core feature
creative mode
delayed for engine release
documentation
duplicate
enhancement
environment
feature request
gameplay
graphics
ground content conflict
GUI/HUD
help wanted
incomplete feature
invalid / won't fix
items
looking for contributor
mapgen
meta
mineclone2+
Minecraft >= 1.13
Minecraft >= 1.17
missing feature
mobile
mobs
mod support
model needed
multiplayer
Needs adoption
needs discussion
needs engine change
needs more information
needs research
nodes
non-mob entities
performance
player
possible close
redstone
release notes
schematics
Skyblock
sounds
Testing / Retest
tools
translation
unconfirmed
mcl5
mcla
Media missing
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: VoxeLibre/VoxeLibre#4216
Loading…
Reference in New Issue
No description provided.
Delete Branch "fix_hungercrash_newgame"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Crash info:
When I create a new game on singlenode and load a custom mob, it crashes. I'm assuming this is the case for all new games. We don't check if the player object is set first so I've added a defensive check in.
Could have done with a little more refactoring so it sets the player entry in a local variable we check first, and maybe also create the relevent object if it isn't created on login.
However, it's better than it was.
Testing
Creating new game no longer crashes
I wasn't able to reproduce this. I tried creating a new singlenode world with Animalia enabled. This seems like an impossible bug. mcl_hunger.eat_internal[name] get setup in register_on_joinplayer. But the player is in minetest.get_connected_players() before on_joinplayer is called?
What mods were you using when you got this crash?
This was with a custom skyblock mod I'm playing around with. Without this fix, it wouldn't load. It may not happen all the time, but does happen (otherwise I wouldn't be able to generate the stack trace).
Understood. I won't be able to use your setup to try to reproduce unless you make that custom skyblock mod available. No worries and no pressure to make it available in a larval state. I'll just keep working on either the bone meal API update or the minecarts update.
Once I'm satisfied with it, or gone as far as I'm willing to go for now, I will release it. I'm just kind of unblocking it and solving issues for now.
With this and the biomes fix, it probably will be releasable.
LGTM
the-real-herowl referenced this pull request2024-08-18 10:24:26 +02:00