Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tales of MajEyal
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
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
K'van
Tales of MajEyal
Commits
40399e81
Commit
40399e81
authored
9 years ago
by
DarkGod
Browse files
Options
Downloads
Patches
Plain Diff
zone:getLevel does not assume a map exists
parent
4f28b8d7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
game/engines/default/engine/Zone.lua
+4
-4
4 additions, 4 deletions
game/engines/default/engine/Zone.lua
with
4 additions
and
4 deletions
game/engines/default/engine/Zone.lua
+
4
−
4
View file @
40399e81
...
...
@@ -858,7 +858,7 @@ function _M:getLevel(game, lev, old_lev, no_close)
game
:
setLevel
(
level
)
-- Recreate the map because it could have been saved with a different tileset or whatever
-- This is not needed in case of a direct to file persistance becuase the map IS recreated each time anyway
level
.
map
:
recreate
()
if
level
.
map
then
level
.
map
:
recreate
()
end
end
popup
:
done
()
elseif
type
(
level_data
.
persistent
)
==
"string"
and
level_data
.
persistent
==
"zone"
and
not
self
.
save_per_level
then
...
...
@@ -874,7 +874,7 @@ function _M:getLevel(game, lev, old_lev, no_close)
game
:
setLevel
(
level
)
-- Recreate the map because it could have been saved with a different tileset or whatever
-- This is not needed in case of a direct to file persistance becuase the map IS recreated each time anyway
level
.
map
:
recreate
()
if
level
.
map
then
level
.
map
:
recreate
()
end
end
popup
:
done
()
elseif
type
(
level_data
.
persistent
)
==
"string"
and
level_data
.
persistent
==
"memory"
then
...
...
@@ -890,7 +890,7 @@ function _M:getLevel(game, lev, old_lev, no_close)
game
:
setLevel
(
level
)
-- Recreate the map because it could have been saved with a different tileset or whatever
-- This is not needed in case of a direct to file persistance becuase the map IS recreated each time anyway
level
.
map
:
recreate
()
if
level
.
map
then
level
.
map
:
recreate
()
end
end
popup
:
done
()
elseif
level_data
.
persistent
then
...
...
@@ -924,7 +924,7 @@ function _M:getLevel(game, lev, old_lev, no_close)
collectgarbage
(
"collect"
)
-- Re-open the level if needed (the method does the check itself)
level
.
map
:
reopen
()
if
level
.
map
then
level
.
map
:
reopen
()
end
return
level
,
new_level
end
...
...
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