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
Otowa Kotori
Tales of MajEyal
Commits
123f3af1
Commit
123f3af1
authored
8 years ago
by
DarkGod
Browse files
Options
Downloads
Patches
Plain Diff
Default targetting now prioritizes targets in line of sight over ESP ones
parent
7a4668e0
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/Target.lua
+6
-2
6 additions, 2 deletions
game/engines/default/engine/Target.lua
with
6 additions
and
2 deletions
game/engines/default/engine/Target.lua
+
6
−
2
View file @
123f3af1
...
...
@@ -704,7 +704,8 @@ function _M:scan(dir, radius, sx, sy, filter, kind)
if
(
not
self
.
source_actor
or
self
.
source_actor
:
canSee
(
a
))
and
(
not
filter
or
filter
(
a
))
then
table.insert
(
actors
,
{
a
=
a
,
dist
=
math.abs
(
sx
-
x
)
*
math.abs
(
sx
-
x
)
+
math.abs
(
sy
-
y
)
*
math.abs
(
sy
-
y
)
dist
=
math.abs
(
sx
-
x
)
*
math.abs
(
sx
-
x
)
+
math.abs
(
sy
-
y
)
*
math.abs
(
sy
-
y
),
has_los
=
(
self
.
source_actor
and
self
.
source_actor
:
hasLOS
(
x
,
y
))
and
1
or
0
,
})
actors
[
a
]
=
true
end
...
...
@@ -720,7 +721,10 @@ function _M:scan(dir, radius, sx, sy, filter, kind)
core
.
fov
.
calc_circle
(
sx
,
sy
,
game
.
level
.
map
.
w
,
game
.
level
.
map
.
h
,
radius
,
checker
,
function
()
end
,
nil
)
end
table.sort
(
actors
,
function
(
a
,
b
)
return
a
.
dist
<
b
.
dist
end
)
table.sort
(
actors
,
function
(
a
,
b
)
if
a
.
has_los
==
b
.
has_los
then
return
a
.
dist
<
b
.
dist
else
return
a
.
has_los
>
b
.
has_los
end
end
)
if
#
actors
>
0
then
self
.
target
.
entity
=
actors
[
1
].
a
self
.
target
.
x
=
self
.
target
.
entity
.
x
...
...
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