From 4310bfed5b0d2d17774244ba3f619a3c0d885e74 Mon Sep 17 00:00:00 2001 From: AiTechEye <40591179+AiTechEye@users.noreply.github.com> Date: Fri, 19 Jun 2020 12:30:16 +0200 Subject: [PATCH] Add files via upload --- init.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 4b20cee..c04edb6 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,6 @@ disable_portal_stuff=false +proportal_group_only = true + portalgun={new=0,checkpoints={}} dofile(minetest.get_modpath("portalgun") .. "/gravityuse.lua") -- the gravity part of portalgun @@ -575,10 +577,11 @@ function portalgun_onuse(itemstack, user, pointed_thing) -- using the gun local nname=minetest.get_node({x=pos.x+(dir.x*i), y=pos.y+(dir.y*i), z=pos.z+(dir.z*i)}).name if minetest.registered_nodes[nname].walkable then portalgun_portal[name].lifelime=portalgun_lifelime - - - if minetest.get_node_group(nname, "antiportal")>0 then + if not proportal_group_only and minetest.get_node_group(nname, "antiportal") > 0 then + minetest.sound_play("portalgun_error", {pos=pos,max_hear_distance = 5, gain = 3}) + return itemstack + elseif proportal_group_only and minetest.get_node_group(nname, "proportal") == 0 then minetest.sound_play("portalgun_error", {pos=pos,max_hear_distance = 5, gain = 3}) return itemstack end