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
Commits
17f61328
Commit
17f61328
authored
13 years ago
by
dg
Browse files
Options
Downloads
Patches
Plain Diff
fix
git-svn-id:
http://svn.net-core.org/repos/t-engine4@3961
51575b47-30f0-44d4-a5cc-537603b46e54
parent
2f3041e2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
game/engines/default/engine/Level.lua
+2
-2
2 additions, 2 deletions
game/engines/default/engine/Level.lua
game/engines/default/engine/Zone.lua
+3
-3
3 additions, 3 deletions
game/engines/default/engine/Zone.lua
with
5 additions
and
5 deletions
game/engines/default/engine/Level.lua
+
2
−
2
View file @
17f61328
...
...
@@ -68,13 +68,13 @@ end
--- Adds an entity to the level
-- Only entities that need to act need to be added. Terrain features do not need this usually
function
_M
:
addEntity
(
e
,
after
)
function
_M
:
addEntity
(
e
,
after
,
no_error
)
if
e
.
_fake_level_entity
then
e
.
_fake_level_entity
(
self
,
"add"
,
after
)
return
end
if
self
.
entities
[
e
.
uid
]
then
error
(
"Entity "
..
e
.
uid
..
"("
..
e
.
name
..
") already present on the level"
)
end
if
self
.
entities
[
e
.
uid
]
then
if
no_error
then
return
else
error
(
"Entity "
..
e
.
uid
..
"("
..
e
.
name
..
") already present on the level"
)
end
end
self
.
entities
[
e
.
uid
]
=
e
if
e
.
addEntityOrder
then
after
=
e
:
addEntityOrder
(
level
)
end
if
not
after
or
not
self
:
hasEntity
(
after
)
then
...
...
This diff is collapsed.
Click to expand it.
game/engines/default/engine/Zone.lua
+
3
−
3
View file @
17f61328
...
...
@@ -480,7 +480,7 @@ function _M:addEntity(level, e, typ, x, y, no_added)
e
.
x
=
nil
e
.
y
=
nil
if
x
and
y
then
e
:
move
(
x
,
y
,
true
)
end
level
:
addEntity
(
e
)
level
:
addEntity
(
e
,
nil
,
true
)
if
not
no_added
then
e
:
added
()
end
-- Levelup ?
if
self
.
actor_adjust_level
and
e
.
forceLevelup
then
...
...
@@ -492,8 +492,8 @@ function _M:addEntity(level, e, typ, x, y, no_added)
e
.
x
=
nil
e
.
y
=
nil
if
x
and
y
then
e
:
move
(
x
,
y
,
true
)
end
if
e
.
src
then
level
:
addEntity
(
e
,
e
.
src
)
else
level
:
addEntity
(
e
)
end
if
e
.
src
then
level
:
addEntity
(
e
,
e
.
src
,
true
)
else
level
:
addEntity
(
e
,
nil
,
true
)
end
if
not
no_added
then
e
:
added
()
end
elseif
typ
==
"object"
then
if
x
and
y
then
level
.
map
:
addObject
(
x
,
y
,
e
)
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