Fix crash throwing snowball at (runaway=true) mobs #2802
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: VoxeLibre/VoxeLibre#2802
Loading…
Reference in New Issue
No description provided.
Delete Branch "fix_snowball_crash"
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?
In case of a snowball (or other projectile i guess) hitting the mob the "hitter" is the thrown object which will in some cases already be gone when processed by the mob resulting in it's get_pos returning nil.
just nil checking objects for this is not enough btw. as the object var itsself can well still be around but all the methods return nil ( https://rubenwardy.com/minetest_modding_book/en/quality/common_mistakes.html#be-careful-when-storing-objectrefs-ie-players-or-entities )
This PR fixes #2800
Testing
sorry about this.
Works 👍
don't worry that's why we're testing things. when you're working on a core mechanic like this theres always many things you just don't think of testing at the time.