remove the obsolete at_gm attribute.

The code did almost nothing, and player-operated quests are no longer something I want to do.
This commit is contained in:
Enno Rehling 2014-12-17 17:32:32 +01:00
parent 8971f59ecc
commit 2a3fdab394
6 changed files with 2 additions and 128 deletions

View File

@ -7,7 +7,6 @@ SET(_FILES
attributes.c
fleechance.c
follow.c
gm.c
hate.c
iceberg.c
key.c

View File

@ -22,7 +22,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/* attributes includes */
#include "follow.h"
#include "gm.h"
#include "hate.h"
#include "iceberg.h"
#include "key.h"
@ -62,7 +61,7 @@ void register_attributes(void)
at_register(&at_raceprefix);
at_register(&at_iceberg);
at_register(&at_key);
at_register(&at_gm);
at_deprecate("gm", a_readint);
at_register(&at_follow);
at_register(&at_targetregion);
at_register(&at_orcification);

View File

@ -1,58 +0,0 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/config.h>
#include "gm.h"
/* kernel includes */
#include <kernel/plane.h>
/* util includes */
#include <util/attrib.h>
#include <storage.h>
static void write_gm(const attrib * a, const void *owner, struct storage *store)
{
write_plane_reference((plane *) a->data.v, store);
}
static int read_gm(attrib * a, void *owner, struct storage *store)
{
plane *pl;
int result = read_plane_reference(&pl, store);
a->data.v = pl;
return result;
}
attrib_type at_gm = {
"gm",
NULL,
NULL,
NULL,
write_gm,
read_gm,
};
attrib *make_gm(const struct plane * pl)
{
attrib *a = a_new(&at_gm);
a->data.v = (void *)pl;
return a;
}

View File

@ -1,35 +0,0 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_GM
#define H_ATTRIBUTE_GM
#ifdef __cplusplus
extern "C" {
#endif
/* this is an attribute used by the kernel (isallied) */
struct plane;
extern struct attrib_type at_gm;
extern struct attrib *make_gm(const struct plane *pl);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -21,7 +21,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/* attributes includes */
#include <attributes/reduceproduction.h>
#include <attributes/gm.h>
/* kernel includes */
#include "alliance.h"
@ -612,39 +611,11 @@ bool unit_has_cursed_item(const unit * u)
return false;
}
static void init_gms(void)
{
faction *f;
for (f = factions; f; f = f->next) {
attrib *a = a_find(f->attribs, &at_gm);
if (a != NULL)
fset(f, FFL_GM);
}
}
static int
autoalliance(const plane * pl, const faction * sf, const faction * f2)
{
static bool init = false;
if (!init) {
init_gms();
init = true;
}
if (pl && (pl->flags & PFL_FRIENDLY))
return HELP_ALL;
/* if f2 is a gm in this plane, everyone has an auto-help to it */
if (fval(f2, FFL_GM)) {
attrib *a = a_find(f2->attribs, &at_gm);
while (a) {
const plane *p = (const plane *)a->data.v;
if (p == pl)
return HELP_ALL;
a = a->next;
}
}
if (f_get_alliance(sf) != NULL && AllianceAuto()) {
if (sf->alliance == f2->alliance)

View File

@ -50,9 +50,7 @@ extern "C" {
#define FFL_NPC (1<<25) /* eine Partei mit Monstern */
#define FFL_DBENTRY (1<<28) /* Partei ist in Datenbank eingetragen */
#define FFL_GM (1<<30) /* eine Partei mit Sonderrechten */
#define FFL_SAVEMASK (FFL_DEFENDER|FFL_NEWID|FFL_GM|FFL_NPC|FFL_DBENTRY|FFL_NOIDLEOUT)
#define FFL_SAVEMASK (FFL_DEFENDER|FFL_NEWID|FFL_NPC|FFL_DBENTRY|FFL_NOIDLEOUT)
typedef struct faction {
struct faction *next;