- Bugfixes mapper

- atoi36 weniger empfindlich gemacht: Ein atoi36("abcd)") gibt jetzt
	nicht mehr Null, sondern den Wert bis zur Klammer. Wichtig
	für mapper. Könnte Nebenwirkungen haben.
This commit is contained in:
Christian Schlittchen 2002-09-26 12:21:25 +00:00
parent 0dbdac747c
commit 4859d603c4
4 changed files with 7 additions and 5 deletions

View File

@ -40,10 +40,11 @@ atoi36(const char * str)
if (isupper((int)*s)) i = i*36 + (*s)-'A' + 10; if (isupper((int)*s)) i = i*36 + (*s)-'A' + 10;
else if (islower((int)*s)) i=i*36 + (*s)-'a' + 10; else if (islower((int)*s)) i=i*36 + (*s)-'a' + 10;
else if (isdigit((int)*s)) i=i*36 + (*s)-'0'; else if (isdigit((int)*s)) i=i*36 + (*s)-'0';
else return 0; else
break;
++s; ++s;
} }
if (i<0 || (!isspace(*s) && *s!='\0')) return 0; if (i<0) return 0;
return i; return i;
} }

View File

@ -624,7 +624,7 @@ NeueBurg(region * r)
b = new_building(bt_find(oldbuildings[q]), r, NULL); b = new_building(bt_find(oldbuildings[q]), r, NULL);
b->size = map_input(win, 2, 2, "Größe", 1, 999, 1); b->size = map_input(win, 2, 2, "Grösse", 1, 99999, 1);
strcpy(buf, my_input(win, 2, 3, "Name: ", NULL)); strcpy(buf, my_input(win, 2, 3, "Name: ", NULL));
if (strlen(buf) > 0) if (strlen(buf) > 0)

View File

@ -1206,7 +1206,7 @@ showunits(region * r)
modified = 1; modified = 1;
if ((s = strchr(pointer->s, '('))!=NULL) { if ((s = strchr(pointer->s, '('))!=NULL) {
s++; s++;
f = atoi(s); f = atoi36(s);
switch (pointer->s[0]) { switch (pointer->s[0]) {
case '\002': case '\002':
b = findbuilding(f); b = findbuilding(f);
@ -1414,7 +1414,7 @@ showunits(region * r)
clipregion = r; clipregion = r;
break; break;
case '\002': case '\002':
f = atoi(s); f = atoi36(s);
b = findbuilding(f); b = findbuilding(f);
for (x = r->units; x; x = x->next) for (x = r->units; x; x = x->next)
if (x->building == b && fval(x, FL_OWNER)) if (x->building == b && fval(x, FL_OWNER))

View File

@ -1055,6 +1055,7 @@ movearound(int rx, int ry) {
break; break;
case 0x2: case 0x2:
make_ocean_block(rx, ry); make_ocean_block(rx, ry);
modified = 1;
ch = -9; ch = -9;
break; break;
case 'a': case 'a':