Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
homedecor_modpack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
homedecor_modpack
Commits
436fdfac
Commit
436fdfac
authored
8 years ago
by
Tim
Browse files
Options
Downloads
Patches
Plain Diff
Prevent crashs in can_dig on nil-player.
parent
df84e627
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
inbox/init.lua
+2
-1
2 additions, 1 deletion
inbox/init.lua
itemframes/init.lua
+4
-4
4 additions, 4 deletions
itemframes/init.lua
with
6 additions
and
5 deletions
inbox/init.lua
+
2
−
1
View file @
436fdfac
...
...
@@ -61,9 +61,10 @@ minetest.register_node("inbox:empty", {
end
,
can_dig
=
function
(
pos
,
player
)
local
meta
=
minetest
.
get_meta
(
pos
);
local
name
=
player
and
player
:
get_player_name
()
local
owner
=
meta
:
get_string
(
"owner"
)
local
inv
=
meta
:
get_inventory
()
return
player
:
get_player_name
()
==
owner
and
inv
:
is_empty
(
"main"
)
return
player
==
owner
and
inv
:
is_empty
(
"main"
)
end
,
on_metadata_inventory_put
=
function
(
pos
,
listname
,
index
,
stack
,
player
)
local
meta
=
minetest
.
get_meta
(
pos
)
...
...
This diff is collapsed.
Click to expand it.
itemframes/init.lua
+
4
−
4
View file @
436fdfac
...
...
@@ -141,9 +141,9 @@ minetest.register_node("itemframes:frame",{
end
end
,
can_dig
=
function
(
pos
,
player
)
local
name
=
player
and
player
:
get_player_name
()
local
meta
=
minetest
.
get_meta
(
pos
)
return
player
:
get_player_
name
()
==
meta
:
get_string
(
"owner"
)
return
name
==
meta
:
get_string
(
"owner"
)
end
,
on_destruct
=
function
(
pos
)
local
meta
=
minetest
.
get_meta
(
pos
)
...
...
@@ -198,9 +198,9 @@ minetest.register_node("itemframes:pedestal",{
end
end
,
can_dig
=
function
(
pos
,
player
)
local
name
=
player
and
player
:
get_player_name
()
local
meta
=
minetest
.
get_meta
(
pos
)
return
player
:
get_player_
name
()
==
meta
:
get_string
(
"owner"
)
return
name
==
meta
:
get_string
(
"owner"
)
end
,
on_destruct
=
function
(
pos
)
local
meta
=
minetest
.
get_meta
(
pos
)
...
...
This diff is collapsed.
Click to expand it.
Milan
@milan
mentioned in commit
32ef2377
·
8 years ago
mentioned in commit
32ef2377
mentioned in commit 32ef2377d4e7fc75166d4cb0525dbbf0aeeff92c
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment