Pocketmine-mp: Teleporting to another level still applies damage of damaging block in the origin level until moving

Created on 9 Nov 2017  路  2Comments  路  Source: pmmp/PocketMine-MP

Issue description


(This issue might be related to what i've shown @dktapps a while ago, where i was stuck inside a bed and did not take any damage, because my position didn't change)

When being, for example in the default level, and being teleported to another level via teleport(Position), you still take damage from a block that damages a player until you move.

Example:

  • Stand on a cactus in the default level
  • Teleport to another level (via teleport(Position)), but DO NOT MOVE
  • The damage still applies to you. When you die, you will see "has been stung to death", confirming that the position is still the same as of the cactus.

What i guess is happening is that on teleport() without any movement, the Level of the passed Position object is not updated, OR in the position of the player. The damage instantly stops when moving just the slightest, for example turning the head.

  • Expected result: What were you expecting to happen?
    Position being properly updated, not getting damage
  • Actual result: What actually happened?
    Getting damage

Steps to reproduce the issue

  1. Steps are described above.

OS and versions

  • PocketMine-MP: 733e61f8150287595ee567770b19b5a7897c4331
  • PHP: 7.2 RC 4

Plugins

  • Test on a clean server without plugins: is the issue reproducible without any plugins loaded?
    Indeed. no plugins installed, just injected a command to pmmp to execute the teleport function

If the issue is not reproducible without plugins:

  • Have you asked for help on our forums before creating an issue?
  • Can you provide sample, minimal reproducing code for the issue? If so, paste it in the bottom section
  • Paste your list of plugins here (use the 'plugins' command in PocketMine-MP)

Crashdump, backtrace or other files

  • Do not paste crashdumps into an issue - please use our Crash Archive at https://crash.pmmp.io for submitting crash reports to not spam the issue tracker. Add links to your reports in the Crash Archive here.
  • Please use gist or anything else to add other files and add links here

  • ...

Core Gameplay Fixed

Most helpful comment

Amusingly the cactus actually continues to attack you after respawning in some cases. Nice find.

All 2 comments

well, this is an interesting case I didn't consider...

Blocks around the entity don't get recomputed until either
a) they move, or
b) a block nearby them gets updated.

Since, as you say, you haven't moved there, those recorded colliding blocks won't get recalculated on teleport. This shouldn't be too difficult to fix.

Amusingly the cactus actually continues to attack you after respawning in some cases. Nice find.

Was this page helpful?
0 / 5 - 0 ratings