ENTITIES/mcl_boats: Fix mob-in-boat crash in Minetest 5.5-dev #249
No reviewers
Labels
No Label
blocker
bug
code quality
confirmed
critical
discussion
high priority
incompatibility
incomplete feature
invalid
low priority
missing feauture
needs testing
packet spam
performance
project
regression
translations
unconfirmed
in review
ready for review
No Milestone
No project
No Assignees
2 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Mineclonia/Mineclonia#249
Loading…
Reference in New Issue
No description provided.
Delete Branch "fix-boat-crash-in-minetest-5.5-dev"
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?
Problem
TRACKING ISSUE: #241
In Minetest 5.4.1, calling get_player_control() on a mob returned the
empty string. Minetest commit 5eb45e1ea03c6104f007efec6dd9c351f310193d
changed this, so now calling get_player_control() on a mob returns nil.
As mcl_boats defines boats that can have a player or a mob as a driver,
code like the following crashes with a changed get_player_control() API:
Furthermore, once a world has crashed, joining it near a mob that is the
driver of a boat with such control code immediately crashes again.
Solution
When I reported this bug to Minetest, several Minetest core developers
stated that they disliked the old API and proposed other return values
for calling a mob's get_player_control() function – all different from
the empty string. Since I have some doubts that this bug will be fixed
in Minetest 5.5.0, boat code must take into account a nil return value.
Details
First time in my life that I proposed a fix to a crash and got only downvotes:
https://github.com/minetest/minetest/pull/11990
Testing Steps
Verify Bug
b1b96e3fac
.2, Find or spawn an mob, e.g. a sheep.
b1b96e3fac
.Verify Fix
b1b96e3fac
.2, Find or spawn an mob, e.g. a sheep.
f89c52dff6
.Testing Steps
Verify Bug
b1b96e3fac
.b1b96e3fac
.Verify Fix
b1b96e3fac
.f89c52dff6
.