From dd9420fc38ca61852b572a7330f20265c738ab39 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 12 Sep 2015 23:38:31 +0200 Subject: [PATCH] move at_guard into guard module as well --- src/guard.c | 11 +++++++++++ src/guard.h | 3 +++ src/kernel/config.c | 12 ++---------- src/kernel/config.h | 1 - tests/data/test.dat | Bin 159 -> 0 bytes tests/orders.txt | 3 --- 6 files changed, 16 insertions(+), 14 deletions(-) delete mode 100644 tests/data/test.dat delete mode 100644 tests/orders.txt diff --git a/src/guard.c b/src/guard.c index c744de126..9e3585a41 100644 --- a/src/guard.c +++ b/src/guard.c @@ -21,6 +21,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "guard.h" +#include #include #include #include @@ -30,6 +31,16 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include +attrib_type at_guard = { + "guard", + DEFAULT_INIT, + DEFAULT_FINALIZE, + DEFAULT_AGE, + a_writeint, + a_readint, + ATF_UNIQUE +}; + void update_guards(void) { const region *r; diff --git a/src/guard.h b/src/guard.h index b2041012d..564be61a2 100644 --- a/src/guard.h +++ b/src/guard.h @@ -9,6 +9,9 @@ extern "C" { struct unit; typedef enum { E_GUARD_OK, E_GUARD_UNARMED, E_GUARD_NEWBIE, E_GUARD_FLEEING } guard_t; + + extern struct attrib_type at_guard; + guard_t can_start_guarding(const struct unit * u); void update_guards(void); unsigned int guard_flags(const struct unit * u); diff --git a/src/kernel/config.c b/src/kernel/config.c index fa11c004f..1db17a495 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -51,6 +51,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "types.h" #include "unit.h" + #include #include @@ -74,6 +75,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "donations.h" +#include "guard.h" #include "prefix.h" #ifdef USE_LIBXML2 @@ -1177,16 +1179,6 @@ attrib_type at_germs = { ATF_UNIQUE }; -attrib_type at_guard = { - "guard", - DEFAULT_INIT, - DEFAULT_FINALIZE, - DEFAULT_AGE, - a_writeint, - a_readint, - ATF_UNIQUE -}; - void setstatus(struct unit *u, int status) { assert(status >= ST_AGGRO && status <= ST_FLEE); diff --git a/src/kernel/config.h b/src/kernel/config.h index 4dc870ff6..91e130706 100644 --- a/src/kernel/config.h +++ b/src/kernel/config.h @@ -306,7 +306,6 @@ extern "C" { void free_gamedata(void); - extern struct attrib_type at_guard; extern struct helpmode helpmodes[]; extern const char *parameters[]; extern const char *localenames[]; diff --git a/tests/data/test.dat b/tests/data/test.dat deleted file mode 100644 index a4f9d46ede1b6d416e983a0c697415f89d3cc6f7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 159 zcma!HWME)oU|?WoW=_pZX%Yo885n?Kt)CXpv}fSR%`eR>NzBaaU|{6*&d*Lw$}CRI z0V&}q%8f5B$F=rT>TeNatQea6+%*kbC%}Om# s&0%KEtt=|aU|`PA%wc9J&dkYXV$aM=PR%P$1=|nO$mj?nfmVPh0AQIZ-2eap diff --git a/tests/orders.txt b/tests/orders.txt deleted file mode 100644 index 3e1e89acb..000000000 --- a/tests/orders.txt +++ /dev/null @@ -1,3 +0,0 @@ -ERESSEA 72vx "naeg86" -EINHEIT nqLx -BENENNEN EINHEIT 'Goldene Herde'