mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-26 03:07:32 +01:00
fix undeacleared vars in mcl_throwing
This commit is contained in:
parent
0da8339352
commit
ead33e3520
@ -58,7 +58,7 @@ function mcl_throwing.dispense_function(stack, dispenserpos, droppos, dropnode,
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Staticdata handling because objects may want to be reloaded
|
-- Staticdata handling because objects may want to be reloaded
|
||||||
local get_staticdata = function(self)
|
function mcl_throwing.get_staticdata(self)
|
||||||
local thrower
|
local thrower
|
||||||
-- Only save thrower if it's a player name
|
-- Only save thrower if it's a player name
|
||||||
if type(self._thrower) == "string" then
|
if type(self._thrower) == "string" then
|
||||||
@ -71,7 +71,7 @@ local get_staticdata = function(self)
|
|||||||
return minetest.serialize(data)
|
return minetest.serialize(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
local on_activate = function(self, staticdata, dtime_s)
|
function mcl_throwing.on_activate(self, staticdata, dtime_s)
|
||||||
local data = minetest.deserialize(staticdata)
|
local data = minetest.deserialize(staticdata)
|
||||||
if data then
|
if data then
|
||||||
self._lastpos = data._lastpos
|
self._lastpos = data._lastpos
|
||||||
|
@ -9,8 +9,8 @@ local snowball_ENTITY={
|
|||||||
collisionbox = {0,0,0,0,0,0},
|
collisionbox = {0,0,0,0,0,0},
|
||||||
pointable = false,
|
pointable = false,
|
||||||
|
|
||||||
get_staticdata = get_staticdata,
|
get_staticdata = mcl_throwing.get_staticdata,
|
||||||
on_activate = on_activate,
|
on_activate = mcl_throwing.on_activate,
|
||||||
_thrower = nil,
|
_thrower = nil,
|
||||||
|
|
||||||
_lastpos={},
|
_lastpos={},
|
||||||
@ -23,8 +23,8 @@ local egg_ENTITY={
|
|||||||
collisionbox = {0,0,0,0,0,0},
|
collisionbox = {0,0,0,0,0,0},
|
||||||
pointable = false,
|
pointable = false,
|
||||||
|
|
||||||
get_staticdata = get_staticdata,
|
get_staticdata = mcl_throwing.get_staticdata,
|
||||||
on_activate = on_activate,
|
on_activate = mcl_throwing.on_activate,
|
||||||
_thrower = nil,
|
_thrower = nil,
|
||||||
|
|
||||||
_lastpos={},
|
_lastpos={},
|
||||||
@ -38,8 +38,8 @@ local pearl_ENTITY={
|
|||||||
collisionbox = {0,0,0,0,0,0},
|
collisionbox = {0,0,0,0,0,0},
|
||||||
pointable = false,
|
pointable = false,
|
||||||
|
|
||||||
get_staticdata = get_staticdata,
|
get_staticdata = mcl_throwing.get_staticdata,
|
||||||
on_activate = on_activate,
|
on_activate = mcl_throwing.on_activate,
|
||||||
|
|
||||||
_lastpos={},
|
_lastpos={},
|
||||||
_thrower = nil, -- Player ObjectRef of the player who threw the ender pearl
|
_thrower = nil, -- Player ObjectRef of the player who threw the ender pearl
|
||||||
|
Loading…
Reference in New Issue
Block a user