CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.7k stars 4.2k forks source link

Incorrect u_teleport function (or documentation?) #77507

Closed Standing-Storm closed 3 weeks ago

Standing-Storm commented 4 weeks ago

Describe the bug

The documentation for u_teleport says

if impassable obstacle occur, the closest point would be picked instead

But this doesn't happen in practice, you end up somewhere randomly nearby instead.

Attach save file

Darfur-trimmed.tar.gz

Steps to reproduce

1) Cast the spell "Traverse the Wilds" and target the cherry tree to the south, which is impassible terrain. 2) You do not end up next to the cherry tree.

Expected behavior

You end up next to the target of the teleport, as indicated in the documentation.

Screenshots

Before: Untitled2

After: Untitled2

Versions and configuration

Additional context

The EoC controlling the teleport is here: https://github.com/Standing-Storm/Cataclysm-DDA/blob/1e022d2315ab046821ca9ef66775c2f3b8dd61ea/data/mods/Xedra_Evolved/mutations/paraclesians/arvore_eocs.json#L247

Procyonae commented 3 weeks ago

Yeah it just picks a random valid point in radius 5 around the target and has done since forced teleporting was added, I'll make a PR changing it bc closest feels like much more desirable behaviour unless I'm missing somewhere that'll trigger abundant unwanted telefragging where multiple creatures are being teled to the same impassable tile in Sky Island or something