File tree 1 file changed +12
-13
lines changed
1 file changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -173,19 +173,18 @@ end
173
173
174
174
175
175
-- Callbacks
176
-
177
- -- respawn player at bed if enabled and valid position is found
178
- minetest .register_on_respawnplayer (function (player )
179
- if not enable_respawn then
180
- return false
181
- end
182
- local name = player :get_player_name ()
183
- local pos = beds .spawn [name ] or nil
184
- if pos then
185
- player :setpos (pos )
186
- return true
187
- end
188
- end )
176
+ -- Only register respawn callback if respawn enabled
177
+ if enable_respawn then
178
+ -- respawn player at bed if enabled and valid position is found
179
+ minetest .register_on_respawnplayer (function (player )
180
+ local name = player :get_player_name ()
181
+ local pos = beds .spawn [name ]
182
+ if pos then
183
+ player :setpos (pos )
184
+ return true
185
+ end
186
+ end )
187
+ end
189
188
190
189
minetest .register_on_leaveplayer (function (player )
191
190
local name = player :get_player_name ()
You can’t perform that action at this time.
0 commit comments