ball tweak

keypad: extract words delimited by spaces
master
rnd1 2016-06-30 17:33:11 +02:00
parent f0a0048c9b
commit 74fa0590ff
2 changed files with 5 additions and 3 deletions

View File

@ -144,7 +144,9 @@ minetest.register_entity("basic_machines:ball",{
local p = obj:getpos();
local d = math.sqrt((p.x-pos.x)^2+(p.y-pos.y)^2+(p.z-pos.z)^2);
if d>0 then
if minetest.is_protected(p,self.owner) then return end
--if minetest.is_protected(p,self.owner) then return end
if math.abs(p.x)>32 or math.abs(p.y)>32 or math.abs(p.z)>32 then return end
if obj:is_player() then -- dont hurt owner
if obj:get_player_name()==self.owner then break end
@ -513,7 +515,7 @@ minetest.register_tool("basic_machines:ball_spell", {
local meta = minetest.deserialize(itemstack:get_metadata());
local owner = meta["owner"] or "";
if minetest.is_protected(pos,owner) then return end
--if minetest.is_protected(pos,owner) then return end
local t0 = spelltime[owner] or 0;
local t1 = minetest.get_gametime();

View File

@ -815,7 +815,7 @@ local function use_keypad(pos,ttl, again) -- position, time to live ( how many t
--extract i-th word from text
local j = 0;
for word in string.gmatch(text, "%a+") do
for word in string.gmatch(text, "%S+") do
j=j+1; if j == i then ttext = word; break; end
end
-- set target keypad's target's infotext