Taking damage on TP
seem0nster opened this issue · comments
Client version: 1.8.9
Server OS: Linux
Expected behavior
To do "/home" from 0,75,0 - -200,25,150 Without taking damage while teleporting.
Actual behavior
Taking damage if the coordinates you are teleporting to are below the Y coord you are at
Maybe the solution
Setting the velocity to 0 while teleporting.
English might be Horrible
Confirmed: I tried with a simple /tp
and the same happen.
I also noticed that when you /tp ~ ~50 ~
you don't get fall damages.
That is strange I think this is supposed to be handled by https://github.com/cuberite/cuberite/blob/master/src/Entities/Player.cpp#L2530-L2559 which is called by Player:TeleportToCords()
duped tho : #5286
hmm, i think it is because it handles fall damage like if you go from Y- 80 to Y- 20, it takes where you fell to, not how long you have spent in the air.
English may be horrible.
Fall damage is currently not handled well. We currently don't look at the y-speed of the player to calculate the damage amount but by looking at the current y-level compared to the previous on-ground y-level:
cuberite/src/Entities/Pawn.cpp
Lines 434 to 463 in 20d5cf0