Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
minetest_game
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Zadrog Pzvotrügen
minetest_game
Commits
6d418e99
Commit
6d418e99
authored
8 years ago
by
adrido
Committed by
Milan
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
merge upstream: Beds: Only register respawn callbacks if respawn is enabled
parent
52f509ba
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mods/beds/functions.lua
+12
-13
12 additions, 13 deletions
mods/beds/functions.lua
with
12 additions
and
13 deletions
mods/beds/functions.lua
+
12
−
13
View file @
6d418e99
...
...
@@ -173,19 +173,18 @@ end
-- Callbacks
-- respawn player at bed if enabled and valid position is found
minetest
.
register_on_respawnplayer
(
function
(
player
)
if
not
enable_respawn
then
return
false
end
local
name
=
player
:
get_player_name
()
local
pos
=
beds
.
spawn
[
name
]
or
nil
if
pos
then
player
:
setpos
(
pos
)
return
true
end
end
)
-- Only register respawn callback if respawn enabled
if
enable_respawn
then
-- respawn player at bed if enabled and valid position is found
minetest
.
register_on_respawnplayer
(
function
(
player
)
local
name
=
player
:
get_player_name
()
local
pos
=
beds
.
spawn
[
name
]
if
pos
then
player
:
setpos
(
pos
)
return
true
end
end
)
end
minetest
.
register_on_leaveplayer
(
function
(
player
)
local
name
=
player
:
get_player_name
()
...
...
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