Improve mob floating #3883
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#3883
Loading…
Reference in New Issue
No description provided.
Delete Branch "Codiac/MineClone2:mob_float_fix"
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?
This changes mob floating so they stay inside the top water node instead of standing on it. The head of the mob should still be above water.
Changes drowning so that mobs will not drown in one block of water. They will drown in 2 or more blocks of water.
Does not appear to affect them getting out of deep water :( But they do seem to die somewhat faster when they stay in deep water.
Testing
Grab some eggs in creative mode and spawn mobs in various depths of water.
FYI the stuff up in the Minclonea patch merge is all mine :(
@ -675,6 +675,9 @@ function mob_class:do_env_damage()
self.standing_in = node_ok(pos, "air").name
self.standing_on = node_ok(pos2, "air").name
local pos3 = {x=pos.x, y=pos.y+1, z=pos.z}
We should use vector.offset for this. The vector functions have assertions in there. This could be invalid and fail further down the line.
I just copied how pos2 is done. Should we just change pos3, change pos2 and pos3, or do a separate PR that changes to vectors in a bunch of places?
I just did pos3.
Thanks. As long as we don't add more to the tech debt bonfire. Ideally we fix surrounding cases as we go, but I won't be that harsh, just yet. You're learning the project, and I don't want the learning curve to be offputting.
Long term, improving code around where we work will help to chip through that tech debt and eventually we'll have a good code base :).
@ -940,3 +944,3 @@
-- in water then float up
if registered_node.groups.water then
if acc and self.floats == 1 then
if acc and self.floats == 1 minetest.registered_nodes[node_ok(vector.offset(pos,0,self.collisionbox[5] -0.25,0)).name].groups.water then
is this missing an and after == 1 ?
Yes, I really did murder that merge. I'll update the PR.
There was something real satisfying about testing this. It wasn't perfect, but it was so wonderful, and a little funny. Thanks for fixing this :).