From ea6cd2ca32e44138a466b7e3135ea4bed6831cf7 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 23 Nov 2016 17:55:44 +0100 Subject: [PATCH] remove unguard trigger. it is unused by the code --- src/modules/gmcmd.c | 1 - src/triggers/CMakeLists.txt | 1 - src/triggers/triggers.c | 2 - src/triggers/unguard.c | 75 ------------------------------------- src/triggers/unguard.h | 32 ---------------- 5 files changed, 111 deletions(-) delete mode 100644 src/triggers/unguard.c delete mode 100644 src/triggers/unguard.h diff --git a/src/modules/gmcmd.c b/src/modules/gmcmd.c index 810867a21..9a4e7ac47 100644 --- a/src/modules/gmcmd.c +++ b/src/modules/gmcmd.c @@ -19,7 +19,6 @@ #include #include #include -#include /* kernel includes */ #include diff --git a/src/triggers/CMakeLists.txt b/src/triggers/CMakeLists.txt index 18561f521..d6670a95b 100644 --- a/src/triggers/CMakeLists.txt +++ b/src/triggers/CMakeLists.txt @@ -11,7 +11,6 @@ killunit.c shock.c timeout.c triggers.c -unguard.c unitmessage.c ) FOREACH(_FILE ${_FILES}) diff --git a/src/triggers/triggers.c b/src/triggers/triggers.c index d5ea7d3d4..433201abd 100644 --- a/src/triggers/triggers.c +++ b/src/triggers/triggers.c @@ -24,7 +24,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include #include #include #include @@ -45,7 +44,6 @@ void register_triggers(void) tt_register(&tt_createcurse); tt_register(&tt_createunit); tt_register(&tt_gate); - tt_register(&tt_unguard); tt_register(&tt_giveitem); tt_register(&tt_killunit); tt_register(&tt_shock); diff --git a/src/triggers/unguard.c b/src/triggers/unguard.c deleted file mode 100644 index 72e611dcc..000000000 --- a/src/triggers/unguard.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - +-------------------+ Christian Schlittchen - | | Enno Rehling - | Eressea PBEM host | Katja Zedel - | (c) 1998 - 2003 | Henning Peters - | | Ingo Wilken - +-------------------+ Stefan Reich - - This program may not be used, modified or distributed - without prior permission by the authors of Eressea. - */ -#include -#include "unguard.h" - -/* kernel includes */ -#include -#include -#include -#include - -/* util includes */ -#include -#include -#include -#include -#include - -/* libc includes */ -#include - -static int unguard_handle(trigger * t, void *data) -{ - building *b = (building *)t->data.v; - - if (b) { - b-> flags |= BLD_UNGUARDED; - } - else { - log_error("could not perform unguard::handle()\n"); - return -1; - } - unused_arg(data); - return 0; -} - -static void unguard_write(const trigger * t, struct storage *store) -{ - write_building_reference((building *)t->data.v, store); -} - -static int unguard_read(trigger * t, gamedata *data) -{ - int rb = read_reference(&t->data.v, data, read_building_reference, - resolve_building); - if (rb == 0 && !t->data.v) { - return AT_READ_FAIL; - } - return AT_READ_OK; -} - -struct trigger_type tt_unguard = { - "building", - NULL, - NULL, - unguard_handle, - unguard_write, - unguard_read -}; - -trigger *trigger_unguard(building * b) -{ - trigger *t = t_new(&tt_unguard); - t->data.v = (void *)b; - return t; -} diff --git a/src/triggers/unguard.h b/src/triggers/unguard.h deleted file mode 100644 index f36f527f8..000000000 --- a/src/triggers/unguard.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - +-------------------+ Christian Schlittchen - | | Enno Rehling - | Eressea PBEM host | Katja Zedel - | (c) 1998 - 2003 | Henning Peters - | | Ingo Wilken - +-------------------+ Stefan Reich - - This program may not be used, modified or distributed - without prior permission by the authors of Eressea. -*/ - -#ifndef UNGUARD_H -#define UNGUARD_H -#ifdef __cplusplus -extern "C" { -#endif - -/* all types we use are defined here to reduce dependencies */ - struct trigger_type; - struct trigger; - struct region; - struct building; - - extern struct trigger_type tt_unguard; - - extern struct trigger *trigger_unguard(struct building *b); - -#ifdef __cplusplus -} -#endif -#endif