From 2a3fdab3940c3b2ac788f4e4cc203d9e32f7f4c6 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 17 Dec 2014 17:32:32 +0100 Subject: [PATCH] remove the obsolete at_gm attribute. The code did almost nothing, and player-operated quests are no longer something I want to do. --- src/attributes/CMakeLists.txt | 1 - src/attributes/attributes.c | 3 +- src/attributes/gm.c | 58 ----------------------------------- src/attributes/gm.h | 35 --------------------- src/kernel/config.c | 29 ------------------ src/kernel/faction.h | 4 +-- 6 files changed, 2 insertions(+), 128 deletions(-) delete mode 100644 src/attributes/gm.c delete mode 100644 src/attributes/gm.h diff --git a/src/attributes/CMakeLists.txt b/src/attributes/CMakeLists.txt index 7bb3f91ba..3317f49b1 100644 --- a/src/attributes/CMakeLists.txt +++ b/src/attributes/CMakeLists.txt @@ -7,7 +7,6 @@ SET(_FILES attributes.c fleechance.c follow.c -gm.c hate.c iceberg.c key.c diff --git a/src/attributes/attributes.c b/src/attributes/attributes.c index b078d062f..37c7418dc 100644 --- a/src/attributes/attributes.c +++ b/src/attributes/attributes.c @@ -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); diff --git a/src/attributes/gm.c b/src/attributes/gm.c deleted file mode 100644 index f5cde3801..000000000 --- a/src/attributes/gm.c +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright (c) 1998-2010, Enno Rehling - Katja Zedel - -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 -#include -#include "gm.h" - -/* kernel includes */ -#include - -/* util includes */ -#include - -#include - -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; -} diff --git a/src/attributes/gm.h b/src/attributes/gm.h deleted file mode 100644 index e1a17bef6..000000000 --- a/src/attributes/gm.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright (c) 1998-2010, Enno Rehling - Katja Zedel - -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 diff --git a/src/kernel/config.c b/src/kernel/config.c index 30f49a186..5821896c1 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -21,7 +21,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* attributes includes */ #include -#include /* 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) diff --git a/src/kernel/faction.h b/src/kernel/faction.h index 3c110424c..c8764392d 100644 --- a/src/kernel/faction.h +++ b/src/kernel/faction.h @@ -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;