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
Lisa Greene
Tales of MajEyal
Commits
a42de32f
Commit
a42de32f
authored
15 years ago
by
dg
Browse files
Options
Downloads
Patches
Plain Diff
fix
git-svn-id:
http://svn.net-core.org/repos/t-engine4@331
51575b47-30f0-44d4-a5cc-537603b46e54
parent
202b3c88
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/engine/Entity.lua
+4
-0
4 additions, 0 deletions
game/engine/Entity.lua
game/engine/interface/ActorAI.lua
+5
-0
5 additions, 0 deletions
game/engine/interface/ActorAI.lua
with
9 additions
and
0 deletions
game/engine/Entity.lua
+
4
−
0
View file @
a42de32f
...
...
@@ -79,6 +79,7 @@ function _M:cloned()
self
.
changed
=
true
end
_M
.
__autoload
=
{}
_M
.
loadNoDelay
=
true
--- If we are loaded we need a new uid
function
_M
:
loaded
()
...
...
@@ -88,6 +89,9 @@ function _M:loaded()
next_uid
=
next_uid
+
1
self
.
changed
=
true
-- hackish :/
if
self
.
autoLoadedAI
then
self
:
autoLoadedAI
()
end
end
--- Change the entity's uid
...
...
This diff is collapsed.
Click to expand it.
game/engine/interface/ActorAI.lua
+
5
−
0
View file @
a42de32f
require
"engine.class"
require
"engine.Actor"
local
Map
=
require
"engine.Map"
--- Handles actors artificial intelligence (or dumbness ... ;)
...
...
@@ -30,6 +31,10 @@ end
function
_M
:
init
(
t
)
self
.
ai_state
=
{}
self
.
ai_target
=
{}
self
:
autoLoadedAI
()
end
function
_M
:
autoLoadedAI
()
-- Make the table with weak values, so that threat list does not prevent garbage collection
setmetatable
(
self
.
ai_target
,
{
__mode
=
'v'
})
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