forked from github/server
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:
parent
8971f59ecc
commit
2a3fdab394
|
@ -7,7 +7,6 @@ SET(_FILES
|
||||||
attributes.c
|
attributes.c
|
||||||
fleechance.c
|
fleechance.c
|
||||||
follow.c
|
follow.c
|
||||||
gm.c
|
|
||||||
hate.c
|
hate.c
|
||||||
iceberg.c
|
iceberg.c
|
||||||
key.c
|
key.c
|
||||||
|
|
|
@ -22,7 +22,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
/* attributes includes */
|
/* attributes includes */
|
||||||
#include "follow.h"
|
#include "follow.h"
|
||||||
#include "gm.h"
|
|
||||||
#include "hate.h"
|
#include "hate.h"
|
||||||
#include "iceberg.h"
|
#include "iceberg.h"
|
||||||
#include "key.h"
|
#include "key.h"
|
||||||
|
@ -62,7 +61,7 @@ void register_attributes(void)
|
||||||
at_register(&at_raceprefix);
|
at_register(&at_raceprefix);
|
||||||
at_register(&at_iceberg);
|
at_register(&at_iceberg);
|
||||||
at_register(&at_key);
|
at_register(&at_key);
|
||||||
at_register(&at_gm);
|
at_deprecate("gm", a_readint);
|
||||||
at_register(&at_follow);
|
at_register(&at_follow);
|
||||||
at_register(&at_targetregion);
|
at_register(&at_targetregion);
|
||||||
at_register(&at_orcification);
|
at_register(&at_orcification);
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
|
@ -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
|
|
|
@ -21,7 +21,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
/* attributes includes */
|
/* attributes includes */
|
||||||
#include <attributes/reduceproduction.h>
|
#include <attributes/reduceproduction.h>
|
||||||
#include <attributes/gm.h>
|
|
||||||
|
|
||||||
/* kernel includes */
|
/* kernel includes */
|
||||||
#include "alliance.h"
|
#include "alliance.h"
|
||||||
|
@ -612,39 +611,11 @@ bool unit_has_cursed_item(const unit * u)
|
||||||
return false;
|
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
|
static int
|
||||||
autoalliance(const plane * pl, const faction * sf, const faction * f2)
|
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))
|
if (pl && (pl->flags & PFL_FRIENDLY))
|
||||||
return HELP_ALL;
|
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 (f_get_alliance(sf) != NULL && AllianceAuto()) {
|
||||||
if (sf->alliance == f2->alliance)
|
if (sf->alliance == f2->alliance)
|
||||||
|
|
|
@ -50,9 +50,7 @@ extern "C" {
|
||||||
#define FFL_NPC (1<<25) /* eine Partei mit Monstern */
|
#define FFL_NPC (1<<25) /* eine Partei mit Monstern */
|
||||||
#define FFL_DBENTRY (1<<28) /* Partei ist in Datenbank eingetragen */
|
#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_NPC|FFL_DBENTRY|FFL_NOIDLEOUT)
|
||||||
|
|
||||||
#define FFL_SAVEMASK (FFL_DEFENDER|FFL_NEWID|FFL_GM|FFL_NPC|FFL_DBENTRY|FFL_NOIDLEOUT)
|
|
||||||
|
|
||||||
typedef struct faction {
|
typedef struct faction {
|
||||||
struct faction *next;
|
struct faction *next;
|
||||||
|
|
Loading…
Reference in New Issue