- no longer asserting on hp<number, but hotfixing and error.

- bugfix zero-quest
- bugfix potion-names
This commit is contained in:
Enno Rehling 2003-03-14 21:03:15 +00:00
parent b16fba0cbb
commit c2273a50a5
5 changed files with 19 additions and 9 deletions

View file

@ -2126,7 +2126,7 @@ report(FILE *F, faction * f, const faction_list * addresses,
for (a=a_find(f->attribs, &at_showitem);a;a=a->nexttype) { for (a=a_find(f->attribs, &at_showitem);a;a=a->nexttype) {
const potion_type * ptype = resource2potion(((const item_type*)a->data.v)->rtype); const potion_type * ptype = resource2potion(((const item_type*)a->data.v)->rtype);
const char * description = NULL; const char * description = NULL;
const char * pname = ptype->resourcename(ptype->itype->rtype, 0); const char * pname = resourcename(ptype->itype->rtype, 0);
requirement * m; requirement * m;
if (ptype==NULL) continue; if (ptype==NULL) continue;
m = ptype->itype->construction->materials; m = ptype->itype->construction->materials;
@ -2149,7 +2149,7 @@ report(FILE *F, faction * f, const faction_list * addresses,
} }
centre(F, buf, true); centre(F, buf, true);
rnl(F); rnl(F);
description = LOC(mkname("potion", pname)); description = LOC(f->locale, mkname("potion", pname));
if (description==pname) description = ptype->text; if (description==pname) description = ptype->text;
centre(F, description, true); centre(F, description, true);
} }

View file

@ -2482,7 +2482,11 @@ aftermath(battle * b)
* for each of them, a peasant will die as well */ * for each of them, a peasant will die as well */
is += dead; is += dead;
} }
assert(du->hp >= du->number || !"unit has less hitpoints than people"); if (du->hp < du->number) {
log_error(("%s has less hitpoints (%u) than people (%u)\n",
itoa36(du->no), du->hp, du->number));
du->hp=du->no;
}
} next(df); } next(df);
} next(s); } next(s);
dead_peasants = min(rpeasants(r), (is*BATTLE_KILLS_PEASANTS)/100); dead_peasants = min(rpeasants(r), (is*BATTLE_KILLS_PEASANTS)/100);

View file

@ -422,7 +422,12 @@ rt_find(const char * name)
return rtype; return rtype;
} }
static const char * it_aliases[2][2] = { { "Runenschwert", "runesword" }, { NULL, NULL } }; static const char * it_aliases[][2] = {
{ "Runenschwert", "runesword" },
{ "p12", "truthpotion" },
{ "p1", "goliathwater" },
{ NULL, NULL },
};
static const char * static const char *
it_alias(const char * zname) it_alias(const char * zname)
{ {
@ -1382,7 +1387,7 @@ static translate_t translation[] = {
{ "Weihrauch", "incense", "incense_p", "incense", "incense_p" }, { "Weihrauch", "incense", "incense_p", "incense", "incense_p" },
{ "Bihänder", "greatsword", "greatsword_p", "greatsword", "greatsword_p" }, { "Bihänder", "greatsword", "greatsword_p", "greatsword", "greatsword_p" },
{ "Laen", "laen", "laen_p", "laen", "laen_p" }, { "Laen", "laen", "laen_p", "laen", "laen_p" },
{ "Goliathwasser", "p1", "p1_p", NULL, NULL }, { "Goliathwasser", "goliathwater", "goliathwater_p", NULL, NULL },
{ "Wasser des Lebens", "p2", "p2_p", NULL, NULL }, { "Wasser des Lebens", "p2", "p2_p", NULL, NULL },
{ "Bauernblut", "p5", "p5_p", NULL, NULL }, { "Bauernblut", "p5", "p5_p", NULL, NULL },
{ "Gehirnschmalz", "p6", "p6_p", NULL, NULL }, { "Gehirnschmalz", "p6", "p6_p", NULL, NULL },

View file

@ -1816,12 +1816,13 @@ zero_quest(void)
{ {
const char * name = "Sergint Saiquent"; const char * name = "Sergint Saiquent";
plane * p = getplanebyname(name); plane * p = getplanebyname(name);
#ifdef ZEROFOKS_QUESTE /* "gregorjochmann@gmx.de" */ #ifdef ZEROFOKS_QUESTMASTER /* "gregorjochmann@gmx.de" */
if (p==NULL { if (p==NULL) {
region * center; region * center;
p = gm_addplane(4, 0, name); p = gm_addplane(4, 0, name);
center = findregion(p->minx+(p->maxx-p->minx)/2, p->miny+(p->maxy-p->miny)/2); center = findregion(p->minx+(p->maxx-p->minx)/2, p->miny+(p->maxy-p->miny)/2);
gm_addfaction(ZEROFOKS_QUESTMASTER, p, center); gm_addfaction(ZEROFOKS_QUESTMASTER, p, center);
return 0;
} }
#endif #endif
if (p!=NULL) { if (p!=NULL) {

View file

@ -1459,7 +1459,7 @@
<string name="p0"> <string name="p0">
<text locale="de">Siebenmeilentee</text> <text locale="de">Siebenmeilentee</text>
</string> </string>
<string name="p1"> <string name="goliathwater">
<text locale="de">Goliathwasser</text> <text locale="de">Goliathwasser</text>
</string> </string>
<string name="p2"> <string name="p2">
@ -1505,7 +1505,7 @@
<string name="p0_p"> <string name="p0_p">
<text locale="de">Siebenmeilentees</text> <text locale="de">Siebenmeilentees</text>
</string> </string>
<string name="goliathwater"> <string name="goliathwater_p">
<text locale="de">Goliathwasser</text> <text locale="de">Goliathwasser</text>
</string> </string>
<string name="p2_p"> <string name="p2_p">