Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tales of MajEyal
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
tome
Tales of MajEyal
Merge requests
!336
Static tmxLoad fixes
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Static tmxLoad fixes
Hachem_Muche/t-engine4:StaticTMXLoadfix
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Hachem_Muche
requested to merge
Hachem_Muche/t-engine4:StaticTMXLoadfix
into
master
8 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
Fixed a character mapping error and added an "undefined tile" warning message for undefined tiles when loading tmx files into a Static map.
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
fc63545e
1 commit,
8 years ago
1 file
+
10
−
8
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
game/engines/default/engine/generator/map/Static.lua
+
10
−
8
Options
@@ -286,7 +286,6 @@ function _M:tmxLoad(file)
end
local
function
populate
(
i
,
j
,
c
,
tid
)
local
ii
,
jj
=
rotate_coords
(
i
,
j
)
m
[
ii
]
=
m
[
ii
]
or
{}
if
type
(
c
)
==
"string"
then
m
[
ii
][
jj
]
=
c
@@ -320,7 +319,7 @@ function _M:tmxLoad(file)
local
x
,
y
=
1
,
1
while
i
<=
#
data
do
gid
,
i
=
struct
.
unpack
(
"<I4"
,
data
,
i
)
if
chars
[
gid
]
then
populate
(
x
,
y
,
chars
[
id
])
if
chars
[
gid
]
then
populate
(
x
,
y
,
chars
[
g
id
])
else
populate
(
x
,
y
,
{[
layername
]
=
gid
},
gid
)
end
x
=
x
+
1
@@ -556,13 +555,16 @@ function _M:generate(lev, old_lev)
else
g
=
self
:
resolve
(
nil
,
c
.
grid
)
end
if
g
then
if
g
.
force_clone
then
g
=
g
:
clone
()
end
g
:
resolve
()
g
:
resolve
(
nil
,
true
)
self
.
map
(
i
-
1
,
j
-
1
,
Map
.
TERRAIN
,
g
)
g
:
check
(
"addedToLevel"
,
self
.
level
,
i
-
1
,
j
-
1
)
g
:
check
(
"on_added"
,
self
.
level
,
i
-
1
,
j
-
1
)
g
:
resolve
()
g
:
resolve
(
nil
,
true
)
else
g
=
self
:
resolve
(
'.'
)
or
self
:
resolve
(
'floor'
)
or
engine
.
Grid
.
new
({
name
=
"undefined grid"
}
)
if
g
then
g
:
resolve
()
g
:
resolve
(
nil
,
true
)
end
print
((
"[generator.map.Static] WARNING: unable to resolve tile '%s' at %d, %d (zone: %s, map:%s), replacing with grid: %s."
):
format
(
type
(
c
)
==
"table"
and
c
.
grid
or
c
,
i
-
1
,
j
-
1
,
self
.
zone
.
short_name
,
self
.
data
.
map
,
g
and
g
.
name
)
)
end
self
.
map
(
i
-
1
,
j
-
1
,
Map
.
TERRAIN
,
g
)
-- print(" => ", g, g and g.name)
g
:
check
(
"addedToLevel"
,
self
.
level
,
i
-
1
,
j
-
1
)
g
:
check
(
"on_added"
,
self
.
level
,
i
-
1
,
j
-
1
)
if
self
.
status_all
then
local
s
=
table
.
clone
(
self
.
status_all
)
if
s
.
lite
then
self
.
level
.
map
.
lites
(
i
-
1
,
j
-
1
,
true
)
s
.
lite
=
nil
end
Loading