@@ -215,13 +215,12 @@ -- is ever even called, so we only need to worry about the -- farcaster-related transmission costs for i,c in pairs(circuit) do if vector.equals(c.pos,pos) then - print('found destination in circuit table',i,dump(c)) -- the destination is listed in the circuit table for j,r in pairs(c.route) do local nc = sorcery.ley.netcaps(pos,1) - print('checking route for sufficient energy to power farcasters', j, nc.freepower) + -- print('checking route for sufficient energy to power farcasters', j, nc.freepower) if nc.freepower < constants.portal_jump_cost_per_farcaster then return false -- only one route to any given portal node -- will be listed in the circuit table, so bail early -- maybe in the future farcasters should charge up, @@ -237,22 +236,17 @@ end local portal_pick_destination = function(dev,circuit,partner) if partner then - print('paired: evaluating partner') if portal_destination_evaluate(circuit,partner) then return partner end - print('partner failed eval') end local scrambled = sorcery.lib.tbl.scramble(circuit) for i=1,#scrambled do - print('evaluating destination',i,dump(scrambled[i])) if portal_destination_evaluate(circuit,scrambled[i].pos) then return scrambled[i].pos end - print('eval failed') end - print('no viable destinations in net') end -- minetest.register_lbm { -- name = 'sorcery:activate_portals'; @@ -295,9 +289,9 @@ end end if cap.self.minpower ~= cap.self.powerdraw then - print("not enough power") + -- print("not enough power") return true end -- clean out user table @@ -330,12 +324,11 @@ local cap = sorcery.ley.netcaps(pos,delta) local jc = (constants.portal_jump_cost_local*delta) if not user.dest and cap.freepower >= jc then user.dest = portal_pick_destination(dev,crc,partner) + sorcery.lib.node.preload(user.dest, u.object) end - if not user.dest then goto skippad else - minetest.load_area(user.dest) - end + if not user.dest then goto skippad end local fac = (user.time / constants.portal_jump_time); minetest.add_particlespawner { time = 1, amount = 100 + (fac * 200); minsize = 0.2 + fac*0.7, maxsize = 0.4 + fac*0.9;