diverse character/int probleme.

This commit is contained in:
Enno Rehling 2001-02-18 12:11:32 +00:00
parent 77140224f8
commit fe788ab2e0
5 changed files with 22 additions and 18 deletions

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: battle.c,v 1.16 2001/02/18 10:06:09 enno Exp $
* $Id: battle.c,v 1.17 2001/02/18 12:11:32 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -2952,8 +2952,12 @@ simplename(region * r)
static char name[17];
const char * cp = rname(r, NULL);
for (i=0;*cp && i!=16;++i, ++cp) {
while (*cp && !isalpha(*cp) && !isspace(*cp)) ++cp;
if (isspace(*cp)) name[i] = '_';
int c = *(unsigned char*)cp;
while (c && !isalpha(c) && !isspace(c)) {
++cp;
c = *(unsigned char*)cp;
}
if (isspace(c)) name[i] = '_';
else name[i] = *cp;
}
name[i]=0;

View File

@ -168,15 +168,15 @@ typedef struct fighter {
struct weapon * weapon; /* offensive weapon */
struct weapon * secondary; /* defensive weapon */
} * person;
#ifdef SHOW_KILLS
int kills;
int hits;
#endif
int flags;
int run_number; /* number of people who have flown */
int run_hp; /* accumulated hp of fleeing people */
struct region *run_to; /* destination of fleeing people */
int action_counter; /* number of active actions the struct unit did in the fight */
#ifdef SHOW_KILLS
int kills;
int hits;
#endif
#ifdef FAST_GETUNITROW
struct {
int alive;

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: border.c,v 1.6 2001/02/18 10:06:09 enno Exp $
* $Id: border.c,v 1.7 2001/02/18 12:11:32 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -106,12 +106,12 @@ read_borders(FILE * f)
assert(type || !"border type not registered");
from = findregion(fx, fy);
if (!from) {
log_error(("ERROR: border for unknown region %d,%d\n", fx, fy));
log_error(("border for unknown region %d,%d\n", fx, fy));
from = new_region(fx, fy);
}
to = findregion(tx, ty);
if (!to) {
log_error(("ERROR: border for unknown region %d,%d\n", tx, ty));
log_error(("border for unknown region %d,%d\n", tx, ty));
to = new_region(tx, ty);
}
if (to==from) {

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: names.c,v 1.3 2001/02/02 08:40:46 enno Exp $
* $Id: names.c,v 1.4 2001/02/18 12:11:32 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -667,7 +667,7 @@ abkz(const char *s, size_t max)
while (*p != 0) {
/* Leerzeichen überspringen */
while (*p != 0 && !isalnum((int)*p))
while (*p != 0 && !isalnum(*(unsigned char*)p))
p++;
/* Counter erhöhen */
@ -675,7 +675,7 @@ abkz(const char *s, size_t max)
c++;
/* alnums überspringen */
while(*p != 0 && isalnum((int)*p))
while(*p != 0 && isalnum(*(unsigned char*)p))
p++;
}
@ -691,12 +691,12 @@ abkz(const char *s, size_t max)
while (*p != 0 && c < max) {
/* Leerzeichen überspringen */
while (*p != 0 && !isalnum((int)*p))
while (*p != 0 && !isalnum(*(unsigned char*)p))
p++;
/* alnums übertragen */
for (i = 0; i < bpt && *p != 0 && isalnum((int)*p); i++) {
for (i = 0; i < bpt && *p != 0 && isalnum(*(unsigned char*)p); i++) {
buf[c] = *p;
c++;
p++;
@ -704,7 +704,7 @@ abkz(const char *s, size_t max)
/* Bis zum nächsten Leerzeichen */
while (c < max && *p != 0 && isalnum((int)*p))
while (c < max && *p != 0 && isalnum(*(unsigned char*)p))
p++;
}

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: changefaction.c,v 1.3 2001/02/10 14:07:29 corwin Exp $
* $Id: changefaction.c,v 1.4 2001/02/18 12:11:32 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -64,7 +64,7 @@ changefaction_handle(trigger * t, void * data)
if (td->unit && td->faction) {
u_setfaction(td->unit, td->faction);
} else {
fprintf(stderr, "\aERROR: could not perform changefaction::handle()\n");
log_error(("could not perform changefaction::handle()\n"));
}
unused(data);
return 0;