Giter VIP home page Giter VIP logo

Comments (3)

BuckarooBanzay avatar BuckarooBanzay commented on May 27, 2024

The "teleport" button triggers a search for air in a 3x3 flat area around the destination, (player pos +- 2 nodes):

if fields.teleport then
if not minetest.check_player_privs(playername, "teleport") then
minetest.chat_send_player(playername, "Missing priv: 'teleport'")
return
end
local pos1 = vector.subtract(item.pos, {x=2, y=0, z=2})
local pos2 = vector.add(item.pos, {x=2, y=0, z=2})
local nodes = minetest.find_nodes_in_area(pos1, pos2, "air")
if #nodes > 0 then
player:set_pos(nodes[1])
minetest.sound_play("whoosh", {pos = nodes[1], gain = 0.5, max_hear_distance = 10})
end

I noticed the failures to teleport too and bumped the limit from originally 1 node around the player (ae12aa3)

Do you know how the target area looks like?
Bumping that to a higher value could solve the problem again, maybe 5 nodes?
With the side-effect that someone can end up on the other side of a wall or in vacuum/lava 😉

from mapserver_mod.

OgelGames avatar OgelGames commented on May 27, 2024

Did some testing and realized what the problem was: the code doesn't load the nodes around the target, so of course there's no air there... 😄 I think adding this on line 49 will fix it:

minetest.get_voxel_manip():read_from_map(pos1, pos2)

Also maybe for bones would it be better to teleport the player above them, in case they are in the air?

from mapserver_mod.

BuckarooBanzay avatar BuckarooBanzay commented on May 27, 2024

the code doesn't load the nodes around the target

ugh, right 👍

Also maybe for bones would it be better to teleport the player above them, in case they are in the air?

good idea, it prevents further death traps if the bones are high up in the air 😄

from mapserver_mod.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.