mirror of
https://gitlab.com/niansa/storybuilder.git
synced 2025-03-06 20:48:28 +01:00
Revert older cleaned up code (Part 2) (8a9cdb8f5b
)
This commit is contained in:
parent
f97b4d0c14
commit
f6ec7b5d39
1 changed files with 8 additions and 2 deletions
|
@ -1,7 +1,5 @@
|
|||
local modpath = minetest.get_modpath("story")
|
||||
local worldpath = minetest.get_worldpath()
|
||||
spos = {}
|
||||
lspos = {}
|
||||
|
||||
-- round
|
||||
function story.get_random_pos()
|
||||
|
@ -31,8 +29,11 @@ function story.reload_stage(name, continuation)
|
|||
minetest.chat_send_player(name, "Not reloading stage as reload is disabled")
|
||||
return false
|
||||
end
|
||||
spos = {}
|
||||
local stage = storybase.get_stage(name)
|
||||
local object = minetest.get_player_by_name(name)
|
||||
-- Stop playing music
|
||||
bgmusic.stop(name)
|
||||
-- Get stage positions
|
||||
storybase.debugmsg(name, "Loading stage " .. stage .. "...")
|
||||
if not story.get_stage(stage) then
|
||||
|
@ -59,5 +60,10 @@ function story.reload_stage(name, continuation)
|
|||
story.stagepos[name] = { x = spos.x, y = spos.y, z = spos.z }
|
||||
-- Remove loading screen
|
||||
player.texhud_remove(object, loadinghud, true)
|
||||
-- Start playing music
|
||||
bgmusic.play(name, music)
|
||||
-- Clean up variables
|
||||
-- spos = nil (TODO: find out why this is causing weeird bugs)
|
||||
music = nil
|
||||
return true
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue