home
·
contact
·
privacy
projects
/
plomrogue
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0f015c3
)
Server/AI: Only hunt enemies up to a certain distance.
author
Christian Heller
<c.heller@plomlompom.de>
Sun, 15 Feb 2015 03:01:31 +0000
(
04:01
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Sun, 15 Feb 2015 03:01:31 +0000
(
04:01
+0100)
src/server/ai.c
patch
|
blob
|
history
diff --git
a/src/server/ai.c
b/src/server/ai.c
index ba1db3842a1f2021b73088a7b5fbbea3be53ab25..1a296ce18ffc7038bed075d77da719be39d817ef 100644
(file)
--- a/
src/server/ai.c
+++ b/
src/server/ai.c
@@
-67,9
+67,9
@@
static char get_dir_from_neighbors(char filter, struct Thing * t_eye,
/* Set (if possible) as "t_eye"'s command a move to the path to the path-wise
* nearest target that is not "t_eye" and fits criteria set by "filter". On
* success, return !0, else 0. Values for "filter":
/* Set (if possible) as "t_eye"'s command a move to the path to the path-wise
* nearest target that is not "t_eye" and fits criteria set by "filter". On
* success, return !0, else 0. Values for "filter":
- * "a": thing in FOV is
animate, but of a type that is not "t_eye"'s, and
- *
starts out weaker than it is; build path as avoiding things of "t_eye"'s
- * type
+ * "a": thing in FOV is
below a certain distance, animate, but of a type that is
+ *
not "t_eye"'s, and starts out weaker than it is; build path as avoiding
+ * t
hings of "t_eye"'s t
ype
* "f": neighbor cell (not inhabited by any animate thing) further away from
* animate thing not further than x steps away and in FOV and of a type
* that is not "t_eye"'s, and starts out stronger or as strong as "t_eye"
* "f": neighbor cell (not inhabited by any animate thing) further away from
* animate thing not further than x steps away and in FOV and of a type
* that is not "t_eye"'s, and starts out stronger or as strong as "t_eye"
@@
-352,6
+352,10
@@
static char get_dir_from_neighbors(char filter, struct Thing * t_eye,
dir_to_nearest_target = 0; /* a certain */
} /* distance. */
}
dir_to_nearest_target = 0; /* a certain */
} /* distance. */
}
+ else if ('a' == filter && 10 <= score_map[pos_i])
+ {
+ dir_to_nearest_target = 0;
+ }
return dir_to_nearest_target;
}
return dir_to_nearest_target;
}