remove unguard trigger.

it is unused by the code
This commit is contained in:
Enno Rehling 2016-11-23 17:55:44 +01:00
parent 13c29c136c
commit ea6cd2ca32
5 changed files with 0 additions and 111 deletions

View file

@ -19,7 +19,6 @@
#include <items/demonseye.h>
#include <attributes/key.h>
#include <triggers/gate.h>
#include <triggers/unguard.h>
/* kernel includes */
#include <kernel/building.h>

View file

@ -11,7 +11,6 @@ killunit.c
shock.c
timeout.c
triggers.c
unguard.c
unitmessage.c
)
FOREACH(_FILE ${_FILES})

View file

@ -24,7 +24,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <triggers/createcurse.h>
#include <triggers/createunit.h>
#include <triggers/gate.h>
#include <triggers/unguard.h>
#include <triggers/giveitem.h>
#include <triggers/killunit.h>
#include <triggers/shock.h>
@ -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);

View file

@ -1,75 +0,0 @@
/*
+-------------------+ Christian Schlittchen <corwin@amber.kn-bremen.de>
| | Enno Rehling <enno@eressea.de>
| Eressea PBEM host | Katja Zedel <katze@felidae.kn-bremen.de>
| (c) 1998 - 2003 | Henning Peters <faroul@beyond.kn-bremen.de>
| | Ingo Wilken <Ingo.Wilken@informatik.uni-oldenburg.de>
+-------------------+ Stefan Reich <reich@halbling.de>
This program may not be used, modified or distributed
without prior permission by the authors of Eressea.
*/
#include <platform.h>
#include "unguard.h"
/* kernel includes */
#include <util/attrib.h>
#include <kernel/building.h>
#include <kernel/region.h>
#include <kernel/unit.h>
/* util includes */
#include <util/attrib.h>
#include <util/event.h>
#include <util/gamedata.h>
#include <util/log.h>
#include <util/resolve.h>
/* libc includes */
#include <stdlib.h>
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;
}

View file

@ -1,32 +0,0 @@
/*
+-------------------+ Christian Schlittchen <corwin@amber.kn-bremen.de>
| | Enno Rehling <enno@eressea.de>
| Eressea PBEM host | Katja Zedel <katze@felidae.kn-bremen.de>
| (c) 1998 - 2003 | Henning Peters <faroul@beyond.kn-bremen.de>
| | Ingo Wilken <Ingo.Wilken@informatik.uni-oldenburg.de>
+-------------------+ Stefan Reich <reich@halbling.de>
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