your-land/bugtracker#4668 13 Movie doesn't start twice

This commit is contained in:
AliasAlreadyTaken 2023-07-28 06:53:17 +02:00
parent 4f2a548344
commit a1301b4b11

View File

@ -1,7 +1,10 @@
if not (yl_cinema.settings.enable_bigscreen and (yl_cinema.settings.enable_bigscreen == true)) then
if not (yl_cinema.settings.enable_screens and (yl_cinema.settings.enable_screens == true)) then
return
end
local warn = yl_cinema.warn
local action = yl_cinema.action
local bigscreen_entity_name = "yl_cinema:movie_bigscreen"
local screen_width = 12
local screen_height = 6.75
@ -75,14 +78,32 @@ end
-- Changepage
local function showpage(ent_obj, movie_id, pagenum)
if not movie_id or not pagenum then
warn("Movie_id or pagenum not found, movie_id=" .. dump(movie_id)..", pagenum="..dump(pagenum))
return ""
end
local movie = yl_cinema.get_movie(movie_id)
local pages = movie.pages
if not movie or pagenum then
warn("Movie_id or pagenum not found, movie_id=" .. dump(movie_id)..", pagenum="..dump(pagenum))
return ""
end
local pages = movie.pages or {}
if not ent_obj then
warn("Cinema Screen Object not found, movie_id=" .. dump(movie_id))
return ""
end
local ent_properties = ent_obj:get_properties()
if ent_properties._playing == true then
warn("Tried to play movie on running projector, movie_id=" .. dump(movie_id))
return ""
end
if pagenum <= #pages then
table.sort(pages, yl_cinema.orderpages)