From 0d76ceabb975983a3d6fe31d4a97ef83d63e9323 Mon Sep 17 00:00:00 2001 From: Christian Schlittchen Date: Thu, 31 Jan 2002 10:58:24 +0000 Subject: [PATCH] =?UTF-8?q?-=20NEUSTART=20war=20v=C3=B6llig=20kaputt,=20ge?= =?UTF-8?q?=C3=A4ndert.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Neustart mit anderer Rasse jetzt ab 81ter Runde, Neustart mit gleicher Rasse ab neunter Runde. FL_RESTARTED rausgenommen, war ohnehin kaputt. --- src/common/gamecode/laws.c | 39 ++++++++++++++++++++++++------------- src/common/kernel/eressea.h | 1 + 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index cc2d9040a..8c94482c7 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -224,7 +224,6 @@ restart(unit *u, const race * rc) strlist ** o=&u->orders; f->magiegebiet = u->faction->magiegebiet; - fset(f, FL_RESTARTED); f->options = u->faction->options; freestrlist(nu->orders); nu->orders = u->orders; @@ -1072,28 +1071,40 @@ quit(void) factionid(u->faction), S->s); } } else if(igetkeyword(S->s, u->faction->locale) == K_RESTART && u->number > 0) { + char *s_race,*s_pass; + if (!landregion(rterrain(r))) { cmistake(u, S->s, 242, MSG_EVENT); continue; } - if (fval(u->faction, FL_RESTARTED)) { - /* schon einmal neustart gemacht */ - return; - } - frace = findrace(getstrtoken(), u->faction->locale); - if (!frace && u->faction->age < 100) { + s_race = getstrtoken(); + frace = findrace(s_race, u->faction->locale); + + if (!frace) { frace = u->faction->race; - } else if (frace == NULL || !playerrace(frace)) { + s_pass = s_race; + } else { + s_pass = getstrtoken(); + } + + if(frace != u->faction->race) { + if(u->faction->age < 81) { + cmistake(u, S->s, 241, MSG_EVENT); + continue; + } + } else { + if(u->faction->age < 9) { + cmistake(u, S->s, 305, MSG_EVENT); + continue; + } + } + + if (!playerrace(frace)) { cmistake(u, S->s, 243, MSG_EVENT); continue; } - if (frace == NULL || !playerrace(frace)) { - cmistake(u, S->s, 243, MSG_EVENT); - continue; - } - - if (strcasecmp(getstrtoken(), u->faction->passw)) { + if (strcasecmp(s_pass, u->faction->passw)) { cmistake(u, S->s, 86, MSG_EVENT); printf(" Warnung: NEUSTART mit falschem Passwort für Partei %s: %s\n", factionid(u->faction), S->s); diff --git a/src/common/kernel/eressea.h b/src/common/kernel/eressea.h index 18a960b3e..c9e7ccb3b 100644 --- a/src/common/kernel/eressea.h +++ b/src/common/kernel/eressea.h @@ -891,6 +891,7 @@ typedef struct skillvalue { #define FL_TAKEALL (1<<25) /* Einheit nimmt alle Gegenstände an */ #define FL_UNNAMED (1<<26) /* Partei/Einheit/Gebäude/Schiff ist unbenannt */ #define FL_RESTARTED (1<<27) /* Partei hat schon einen Neustart gemacht */ + /* no longer used, may contain old data! */ /* Flags, die gespeichert werden sollen: */ #ifdef NOAID