trigger-warnung und do_once korrektur

This commit is contained in:
Enno Rehling 2001-02-20 22:54:05 +00:00
parent ae3a05dd23
commit 3e4303858a
2 changed files with 33 additions and 15 deletions

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: timeout.c,v 1.2 2001/01/26 16:19:41 enno Exp $ * $Id: timeout.c,v 1.3 2001/02/20 22:54:05 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -16,7 +16,9 @@
#include <eressea.h> #include <eressea.h>
#include "timeout.h" #include "timeout.h"
/* util includes */
#include <event.h> #include <event.h>
#include <log.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -72,6 +74,14 @@ timeout_read(trigger * t, FILE * F)
timeout_data * td = (timeout_data*)t->data.v; timeout_data * td = (timeout_data*)t->data.v;
fscanf(F, "%d", &td->timer); fscanf(F, "%d", &td->timer);
read_triggers(F, &td->triggers); read_triggers(F, &td->triggers);
if (td->timer>10) {
trigger * tr = td->triggers;
log_warning(("there is a timeout lasting for another %d turns\n", td->timer));
while (tr) {
log_warning((" timeout triggers: %s\n", tr->type->name));
tr = tr->next;
}
}
return (td->triggers!=NULL && td->timer>0); return (td->triggers!=NULL && td->timer>0);
} }

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: korrektur.c,v 1.27 2001/02/18 09:21:11 katze Exp $ * $Id: korrektur.c,v 1.28 2001/02/20 22:54:05 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -161,9 +161,12 @@ fix_skills(void)
log_warning(("[do_once] a unique fix was called a second time\n")); \ log_warning(("[do_once] a unique fix was called a second time\n")); \
return; \ return; \
} \ } \
else (fun); \ else { \
(fun); \
a_add(&global.attribs, make_key(magic)); \
} \
} }
#if 0
static void static void
fix_vertrautenmagie(void) fix_vertrautenmagie(void)
{ {
@ -228,6 +231,7 @@ fix_vertrautenmagie(void)
} }
} }
} }
#endif
#if 0 #if 0
static void static void
@ -1243,6 +1247,7 @@ fix_balsamfiasko(void)
} }
#endif #endif
#if 0
static int static int
count_demand(const region *r) count_demand(const region *r)
{ {
@ -1253,6 +1258,7 @@ count_demand(const region *r)
} }
return c; return c;
} }
#endif
static int static int
recurse_regions(region * r, regionlist **rlist, boolean(*fun)(const region * r)) recurse_regions(region * r, regionlist **rlist, boolean(*fun)(const region * r))
@ -1276,6 +1282,7 @@ recurse_regions(region * r, regionlist **rlist, boolean(*fun)(const region * r))
static int maxluxuries = 0; static int maxluxuries = 0;
#if 0
static boolean static boolean
f_nolux(const region * r) f_nolux(const region * r)
{ {
@ -1357,6 +1364,7 @@ fix_demand_region(region *r)
rlist = rl; rlist = rl;
} }
} }
#endif
extern attrib * make_atgmcreate(const struct item_type * itype); extern attrib * make_atgmcreate(const struct item_type * itype);
extern attrib * make_atpermissions(void); extern attrib * make_atpermissions(void);
@ -1379,6 +1387,7 @@ make_gms(void)
} }
} }
#if 0
static void static void
fix_demand(void) fix_demand(void)
{ {
@ -1393,6 +1402,7 @@ fix_demand(void)
} }
} }
} }
#endif
#if 0 #if 0
static void static void
@ -1894,13 +1904,16 @@ convert_triggers(void)
} }
#endif #endif
#if 0
#include <items/lmsreward.h> #include <items/lmsreward.h>
static void static void
lms_special(unit * u) lms_special(unit * u)
{ {
if (u) i_change(&u->items, &it_lmsreward, 1); if (u) i_change(&u->items, &it_lmsreward, 1);
} }
#endif
#if 0
#define LIFEEXPECTANCY (27*40) #define LIFEEXPECTANCY (27*40)
static void static void
undo_deadpeasants(void) undo_deadpeasants(void)
@ -1912,6 +1925,7 @@ undo_deadpeasants(void)
r = r->next; r = r->next;
} }
} }
#endif
void void
fix_targetregion_resolve(void) fix_targetregion_resolve(void)
@ -1942,10 +1956,10 @@ fix_baumringel(void)
} }
} }
#if 0
#include <modules/gmcmd.h> #include <modules/gmcmd.h>
void setup_gm_faction(void);
#include <attributes/gm.h> #include <attributes/gm.h>
void setup_gm_faction(void);
static void static void
set_atgm(faction * f) set_atgm(faction * f)
{ {
@ -1956,6 +1970,7 @@ set_atgm(faction * f)
p = p->next; p = p->next;
} }
} }
#endif
void void
korrektur(void) korrektur(void)
@ -1964,14 +1979,12 @@ korrektur(void)
setup_gm_faction(); setup_gm_faction();
#endif #endif
make_gms(); make_gms();
do_once(atoi36("rrgm"), set_atgm(findfaction(atoi36("rr"))));
/* Wieder entfernen! */ /* Wieder entfernen! */
do_once(atoi36("trgr"), fix_targetregion_resolve());
verify_owners(false); verify_owners(false);
/* fix_herbtypes(); */ /* fix_herbtypes(); */
#ifdef CONVERT_TRIGGER #ifdef CONVERT_TRIGGER
do_once(atoi36("cvtr"), convert_triggers()); convert_triggers();
#endif #endif
fix_migrants(); fix_migrants();
fix_allies(); fix_allies();
@ -2023,11 +2036,6 @@ korrektur(void)
init_mwarden(); init_mwarden();
break; break;
} }
do_once(atoi36("fxfa"), fix_vertrautenmagie());
do_once(atoi36("uddp"), undo_deadpeasants());
do_once(atoi36("lmsr"), lms_special(findunit(atoi36("tt3g"))))
do_once(atoi36("brng"), fix_baumringel());
do_once(atoi36("demd"), fix_demand());
/* trade_orders(); */ /* trade_orders(); */
if (global.data_version < NEWROAD_VERSION) { if (global.data_version < NEWROAD_VERSION) {