Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xdecor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
xdecor
Commits
beeda8cb
Commit
beeda8cb
authored
8 years ago
by
Tim
Browse files
Options
Downloads
Patches
Plain Diff
Don't crash on nil-player in can_dig and check the right players for attachment in chairs.
parent
73a29be6
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
handlers/animations.lua
+3
-7
3 additions, 7 deletions
handlers/animations.lua
itemframe.lua
+2
-2
2 additions, 2 deletions
itemframe.lua
mailbox.lua
+2
-2
2 additions, 2 deletions
mailbox.lua
with
7 additions
and
11 deletions
handlers/animations.lua
+
3
−
7
View file @
beeda8cb
...
...
@@ -40,13 +40,9 @@ function xdecor.sit(pos, node, clicker, pointed_thing)
end
end
function
xdecor
.
sit_dig
(
pos
,
player
)
local
pname
=
player
:
get_player_name
()
local
objs
=
minetest
.
get_objects_inside_radius
(
pos
,
0
.
1
)
for
_
,
p
in
pairs
(
objs
)
do
if
not
player
or
not
player
:
is_player
()
or
p
:
get_player_name
()
or
default
.
player_attached
[
pname
]
then
function
xdecor
.
sit_dig
(
pos
,
digger
)
for
_
,
player
in
pairs
(
minetest
.
get_objects_inside_radius
(
pos
,
0
.
1
))
do
if
player
:
is_player
()
and
default
.
player_attached
[
player
:
get_player_name
()]
then
return
false
end
end
...
...
This diff is collapsed.
Click to expand it.
itemframe.lua
+
2
−
2
View file @
beeda8cb
...
...
@@ -94,10 +94,10 @@ end
function
itemframe
.
dig
(
pos
,
player
)
local
meta
=
minetest
.
get_meta
(
pos
)
local
pname
=
player
:
get_player_name
()
local
pname
=
player
and
player
:
get_player_name
()
local
owner
=
meta
:
get_string
(
"owner"
)
return
player
and
pname
==
owner
return
pname
==
owner
end
xdecor
.
register
(
"itemframe"
,
{
...
...
This diff is collapsed.
Click to expand it.
mailbox.lua
+
2
−
2
View file @
beeda8cb
...
...
@@ -78,10 +78,10 @@ end
function
mailbox
.
dig
(
pos
,
player
)
local
meta
=
minetest
.
get_meta
(
pos
)
local
owner
=
meta
:
get_string
(
"owner"
)
local
player_name
=
player
:
get_player_name
()
local
player_name
=
player
and
player
:
get_player_name
()
local
inv
=
meta
:
get_inventory
()
return
inv
:
is_empty
(
"mailbox"
)
and
player
and
player_name
==
owner
return
inv
:
is_empty
(
"mailbox"
)
and
player_name
==
owner
end
function
mailbox
.
after_place_node
(
pos
,
placer
)
...
...
This diff is collapsed.
Click to expand it.
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