cityrpg / CityRPG

A sandbox-simulation styled mod for the game Blockland that simulates the life of a blocky city. Live, build, and thrive in a city made of blocks.
4 stars 3 forks source link

The doPlayerTeleport event can be abused to teleport players through walls #16

Closed LakeYS closed 4 years ago

LakeYS commented 4 years ago

Using the "Relative" option, players can teleport themselves through walls using the doPlayerTeleport option.

The easy solution would be to simply override the relative option in a package hook, however I'd like to try de-registering and re-registering it to remove the option from the interface.

Dglider commented 4 years ago

I believe registering overwrites the old entry. At least that's what it screams at me in the console whenever I do it.

LakeYS commented 4 years ago

Can un-register it using unRegisterOutputEvent, I'm going to give this a shot shortly. If all else fails, it's also possible to manipulate the values directly and refresh the event tables.

The bigger question with this might actually be how to detect if doPlayerTeleport is enabled or not, given that the situation changes depending on game-mode, required add-on config, etc.