forked from github/server
Unicode WIP, does not compile.
- finishing for today, several more files compile.
This commit is contained in:
parent
39ce1bd0dd
commit
588c136071
|
@ -2368,8 +2368,8 @@ origin_cmd(unit * u, struct order * ord)
|
||||||
init_tokens(ord);
|
init_tokens(ord);
|
||||||
skip_token();
|
skip_token();
|
||||||
|
|
||||||
px = (short)atoi(getstrtoken());
|
px = (short)getint();
|
||||||
py = (short)atoi(getstrtoken());
|
py = (short)getint();
|
||||||
|
|
||||||
set_ursprung(u->faction, getplaneid(u->region), px, py);
|
set_ursprung(u->faction, getplaneid(u->region), px, py);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2443,7 +2443,7 @@ status_cmd(unit * u, struct order * ord)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (strlen(param)) {
|
if (param[0]) {
|
||||||
add_message(&u->faction->msgs,
|
add_message(&u->faction->msgs,
|
||||||
msg_feedback(u, ord, "unknown_status", ""));
|
msg_feedback(u, ord, "unknown_status", ""));
|
||||||
} else {
|
} else {
|
||||||
|
@ -2473,8 +2473,7 @@ combatspell_cmd(unit * u, struct order * ord)
|
||||||
/* Optional: STUFE n */
|
/* Optional: STUFE n */
|
||||||
if (findparam(s, u->faction->locale) == P_LEVEL) {
|
if (findparam(s, u->faction->locale) == P_LEVEL) {
|
||||||
/* Merken, setzen kommt erst später */
|
/* Merken, setzen kommt erst später */
|
||||||
s = getstrtoken();
|
level = getint();
|
||||||
level = atoi(s);
|
|
||||||
level = max(0, level);
|
level = max(0, level);
|
||||||
s = getstrtoken();
|
s = getstrtoken();
|
||||||
}
|
}
|
||||||
|
@ -2872,7 +2871,7 @@ renumber_cmd(unit * u, order * ord)
|
||||||
case P_FACTION:
|
case P_FACTION:
|
||||||
s = getstrtoken();
|
s = getstrtoken();
|
||||||
if (s && *s) {
|
if (s && *s) {
|
||||||
int id = atoi36(s);
|
int id = atoi36((const char *)s);
|
||||||
attrib * a = a_find(f->attribs, &at_number);
|
attrib * a = a_find(f->attribs, &at_number);
|
||||||
if (!a) a = a_add(&f->attribs, a_new(&at_number));
|
if (!a) a = a_add(&f->attribs, a_new(&at_number));
|
||||||
a->data.i = id;
|
a->data.i = id;
|
||||||
|
@ -2884,7 +2883,7 @@ renumber_cmd(unit * u, order * ord)
|
||||||
if (s == NULL || *s == 0) {
|
if (s == NULL || *s == 0) {
|
||||||
i = newunitid();
|
i = newunitid();
|
||||||
} else {
|
} else {
|
||||||
i = atoi36(s);
|
i = atoi36((const char *)s);
|
||||||
if (i<=0 || i>MAX_UNIT_NR) {
|
if (i<=0 || i>MAX_UNIT_NR) {
|
||||||
cmistake(u, ord, 114, MSG_EVENT);
|
cmistake(u, ord, 114, MSG_EVENT);
|
||||||
break;
|
break;
|
||||||
|
@ -2926,7 +2925,7 @@ renumber_cmd(unit * u, order * ord)
|
||||||
if (s == NULL || *s == 0) {
|
if (s == NULL || *s == 0) {
|
||||||
i = newcontainerid();
|
i = newcontainerid();
|
||||||
} else {
|
} else {
|
||||||
i = atoi36(s);
|
i = atoi36((const char *)s);
|
||||||
if (i<=0 || i>MAX_CONTAINER_NR) {
|
if (i<=0 || i>MAX_CONTAINER_NR) {
|
||||||
cmistake(u,ord,114,MSG_EVENT);
|
cmistake(u,ord,114,MSG_EVENT);
|
||||||
break;
|
break;
|
||||||
|
@ -2954,7 +2953,7 @@ renumber_cmd(unit * u, order * ord)
|
||||||
if(*s == 0) {
|
if(*s == 0) {
|
||||||
i = newcontainerid();
|
i = newcontainerid();
|
||||||
} else {
|
} else {
|
||||||
i = atoi36(s);
|
i = atoi36((const char *)s);
|
||||||
if (i<=0 || i>MAX_CONTAINER_NR) {
|
if (i<=0 || i>MAX_CONTAINER_NR) {
|
||||||
cmistake(u,ord,114,MSG_EVENT);
|
cmistake(u,ord,114,MSG_EVENT);
|
||||||
break;
|
break;
|
||||||
|
@ -3195,7 +3194,7 @@ new_units (void)
|
||||||
skip_token();
|
skip_token();
|
||||||
if (getparam(u->faction->locale) == P_TEMP) {
|
if (getparam(u->faction->locale) == P_TEMP) {
|
||||||
const xmlChar * token;
|
const xmlChar * token;
|
||||||
char * name = NULL;
|
xmlChar * name = NULL;
|
||||||
int alias;
|
int alias;
|
||||||
order ** newordersp;
|
order ** newordersp;
|
||||||
|
|
||||||
|
@ -3223,8 +3222,8 @@ new_units (void)
|
||||||
alias = getid();
|
alias = getid();
|
||||||
|
|
||||||
token = getstrtoken();
|
token = getstrtoken();
|
||||||
if (token && strlen(token)>0) {
|
if (token && token[0]) {
|
||||||
name = strdup(token);
|
name = xstrdup(token);
|
||||||
}
|
}
|
||||||
u2 = create_unit(r, u->faction, 0, u->faction->race, alias, name, u);
|
u2 = create_unit(r, u->faction, 0, u->faction->race, alias, name, u);
|
||||||
if (name!=NULL) free(name);
|
if (name!=NULL) free(name);
|
||||||
|
@ -3511,11 +3510,11 @@ defaultorders (void)
|
||||||
while (*ordp!=NULL) {
|
while (*ordp!=NULL) {
|
||||||
order * ord = *ordp;
|
order * ord = *ordp;
|
||||||
if (get_keyword(ord)==K_DEFAULT) {
|
if (get_keyword(ord)==K_DEFAULT) {
|
||||||
char * cmd;
|
const xmlChar * cmd;
|
||||||
order * new_order;
|
order * new_order;
|
||||||
init_tokens(ord);
|
init_tokens(ord);
|
||||||
skip_token(); /* skip the keyword */
|
skip_token(); /* skip the keyword */
|
||||||
cmd = strdup(getstrtoken());
|
cmd = getstrtoken();
|
||||||
new_order = parse_order(cmd, u->faction->locale);
|
new_order = parse_order(cmd, u->faction->locale);
|
||||||
*ordp = ord->next;
|
*ordp = ord->next;
|
||||||
ord->next = NULL;
|
ord->next = NULL;
|
||||||
|
@ -3532,7 +3531,6 @@ defaultorders (void)
|
||||||
}
|
}
|
||||||
if (new_order) addlist(&u->old_orders, new_order);
|
if (new_order) addlist(&u->old_orders, new_order);
|
||||||
#endif
|
#endif
|
||||||
free(cmd);
|
|
||||||
}
|
}
|
||||||
else ordp = &ord->next;
|
else ordp = &ord->next;
|
||||||
}
|
}
|
||||||
|
@ -3588,7 +3586,7 @@ use_cmd(unit * u, struct order * ord)
|
||||||
skip_token();
|
skip_token();
|
||||||
|
|
||||||
t = getstrtoken();
|
t = getstrtoken();
|
||||||
n = atoi(t);
|
n = atoi((const char *)t);
|
||||||
if (n==0) {
|
if (n==0) {
|
||||||
if (findparam(t, u->faction->locale) == P_ANY) {
|
if (findparam(t, u->faction->locale) == P_ANY) {
|
||||||
/* BENUTZE ALLES Yanxspirit */
|
/* BENUTZE ALLES Yanxspirit */
|
||||||
|
@ -3627,7 +3625,7 @@ claim_cmd(unit * u, struct order * ord)
|
||||||
skip_token();
|
skip_token();
|
||||||
|
|
||||||
t = getstrtoken();
|
t = getstrtoken();
|
||||||
n = atoi(t);
|
n = atoi((const char *)t);
|
||||||
if (n==0) {
|
if (n==0) {
|
||||||
n = 1;
|
n = 1;
|
||||||
} else {
|
} else {
|
||||||
|
@ -3866,7 +3864,7 @@ warn_password(void)
|
||||||
}
|
}
|
||||||
if (pwok == false) {
|
if (pwok == false) {
|
||||||
free(f->passw);
|
free(f->passw);
|
||||||
f->passw = strdup(itoa36(rng_int()));
|
f->passw = (xmlChar*)strdup(itoa36(rng_int()));
|
||||||
ADDMSG(&f->msgs, msg_message("illegal_password", "newpass", f->passw));
|
ADDMSG(&f->msgs, msg_message("illegal_password", "newpass", f->passw));
|
||||||
}
|
}
|
||||||
f = f->next;
|
f = f->next;
|
||||||
|
|
|
@ -346,7 +346,7 @@ destroy_cmd(unit * u, struct order * ord)
|
||||||
region * r = u->region;
|
region * r = u->region;
|
||||||
const construction * con = NULL;
|
const construction * con = NULL;
|
||||||
int size = 0;
|
int size = 0;
|
||||||
const char *s;
|
const xmlChar *s;
|
||||||
int n = INT_MAX;
|
int n = INT_MAX;
|
||||||
|
|
||||||
if (u->number < 1)
|
if (u->number < 1)
|
||||||
|
@ -362,7 +362,7 @@ destroy_cmd(unit * u, struct order * ord)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s && *s) {
|
if (s && *s) {
|
||||||
n = atoi(s);
|
n = atoi((const char *)s);
|
||||||
if (n <= 0) {
|
if (n <= 0) {
|
||||||
cmistake(u, ord, 288, MSG_PRODUCE);
|
cmistake(u, ord, 288, MSG_PRODUCE);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -508,9 +508,7 @@ build_road(region * r, unit * u, int size, direction_t d)
|
||||||
|
|
||||||
/* hoffentlich ist r->road <= r->terrain->max_road, n also >= 0 */
|
/* hoffentlich ist r->road <= r->terrain->max_road, n also >= 0 */
|
||||||
if (left <= 0) {
|
if (left <= 0) {
|
||||||
sprintf(buf, "In %s gibt es keine Brücken und Straßen "
|
ADDMSG(&u->faction->msgs, msg_feedback(u, u->thisorder, "error_roads_finished", ""));
|
||||||
"mehr zu bauen", regionname(r, u->faction));
|
|
||||||
mistake(u, u->thisorder, buf, MSG_PRODUCE);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -818,7 +816,7 @@ build_building(unit * u, const building_type * btype, int want, order * ord)
|
||||||
building * b = NULL;
|
building * b = NULL;
|
||||||
/* einmalige Korrektur */
|
/* einmalige Korrektur */
|
||||||
static char buffer[8 + IDSIZE + 1 + NAMESIZE + 1];
|
static char buffer[8 + IDSIZE + 1 + NAMESIZE + 1];
|
||||||
const char * btname;
|
const xmlChar * btname;
|
||||||
order * new_order = NULL;
|
order * new_order = NULL;
|
||||||
const struct locale * lang = u->faction->locale;
|
const struct locale * lang = u->faction->locale;
|
||||||
|
|
||||||
|
@ -834,7 +832,7 @@ build_building(unit * u, const building_type * btype, int want, order * ord)
|
||||||
* baut man an der eigenen burg weiter. */
|
* baut man an der eigenen burg weiter. */
|
||||||
|
|
||||||
/* Wenn die angegebene Nummer falsch ist, KEINE Burg bauen! */
|
/* Wenn die angegebene Nummer falsch ist, KEINE Burg bauen! */
|
||||||
id = atoi36(getstrtoken());
|
id = getid();
|
||||||
if (id!=0){ /* eine Nummer angegeben, keine neue Burg bauen */
|
if (id!=0){ /* eine Nummer angegeben, keine neue Burg bauen */
|
||||||
b = findbuilding(id);
|
b = findbuilding(id);
|
||||||
if (!b || b->region != u->region){ /* eine Burg mit dieser Nummer gibt es hier nicht */
|
if (!b || b->region != u->region){ /* eine Burg mit dieser Nummer gibt es hier nicht */
|
||||||
|
@ -1013,9 +1011,8 @@ create_ship(region * r, unit * u, const struct ship_type * newtype, int want, or
|
||||||
|
|
||||||
/* check if skill and material for 1 size is available */
|
/* check if skill and material for 1 size is available */
|
||||||
if (eff_skill(u, cons->skill, r) < cons->minskill) {
|
if (eff_skill(u, cons->skill, r) < cons->minskill) {
|
||||||
sprintf(buf, "Um %s zu bauen, braucht man ein Talent von "
|
ADDMSG(&u->faction->msgs, msg_feedback(u, u->thisorder, "error_build_skill_low", "value name",
|
||||||
"mindestens %d.", newtype->name[1], cons->minskill);
|
cons->minskill, newtype->name[1]));
|
||||||
mistake(u, ord, buf, MSG_PRODUCE);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1073,9 +1070,8 @@ continue_ship(region * r, unit * u, int want)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (eff_skill(u, cons->skill, r) < cons->minskill) {
|
if (eff_skill(u, cons->skill, r) < cons->minskill) {
|
||||||
sprintf(buf, "Um %s zu bauen, braucht man ein Talent von "
|
ADDMSG(&u->faction->msgs, msg_feedback(u, u->thisorder, "error_build_skill_low", "value name",
|
||||||
"mindestens %d.", sh->type->name[1], cons->minskill);
|
cons->minskill, sh->type->name[1]));
|
||||||
mistake(u, u->thisorder, buf, MSG_PRODUCE);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
msize = maxbuild(u, cons);
|
msize = maxbuild(u, cons);
|
||||||
|
@ -1132,8 +1128,7 @@ leave_cmd(unit * u, struct order * ord)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!slipthru(r, u, u->building)) {
|
if (!slipthru(r, u, u->building)) {
|
||||||
sprintf(buf, "%s wird belagert.", buildingname(u->building));
|
ADDMSG(&u->faction->msgs, msg_feedback(u, u->thisorder, "entrance_besieged", "building", u->building));
|
||||||
mistake(u, ord, buf, MSG_MOVE);
|
|
||||||
} else {
|
} else {
|
||||||
leave(r, u);
|
leave(r, u);
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,11 +133,7 @@ bt_find(const char* name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (btl && strcasecmp(btl->type->_name, name)) btl = btl->next;
|
while (btl && strcmp(btl->type->_name, name)) btl = btl->next;
|
||||||
if (!btl) {
|
|
||||||
btl = buildingtypes;
|
|
||||||
while (btl && strncasecmp(btl->type->_name, name, strlen(name))) btl = btl->next;
|
|
||||||
}
|
|
||||||
return btl?btl->type:NULL;
|
return btl?btl->type:NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -170,15 +170,15 @@ checkpasswd(const faction * f, const xmlChar * passwd, boolean shortp)
|
||||||
#ifdef SHORTPWDS
|
#ifdef SHORTPWDS
|
||||||
shortpwd * slist = f->shortpwds;
|
shortpwd * slist = f->shortpwds;
|
||||||
if (shortp) while (slist) {
|
if (shortp) while (slist) {
|
||||||
if (strcasecmp(slist->pwd, passwd)==0) {
|
if (xstrcmp(slist->pwd, passwd)==0) {
|
||||||
slist->used = true;
|
slist->used = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
slist = slist->next;
|
slist = slist->next;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (xmlStrcmp(f->passw, passwd)==0) return true;
|
if (xstrcmp(f->passw, passwd)==0) return true;
|
||||||
if (xmlStrcmp(f->override, passwd)==0) return true;
|
if (xstrcmp(f->override, passwd)==0) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -140,7 +140,7 @@ join_group(unit * u, const xmlChar * name)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (a) ((group *)(a->data.v))->members--;
|
if (a) ((group *)(a->data.v))->members--;
|
||||||
if (!name || !strlen(name)) {
|
if (!name || !xstrlen(name)) {
|
||||||
if (a) {
|
if (a) {
|
||||||
a_remove(&u->attribs, a);
|
a_remove(&u->attribs, a);
|
||||||
freset(u, UFL_GROUP);
|
freset(u, UFL_GROUP);
|
||||||
|
@ -189,7 +189,7 @@ read_groups(FILE * F, faction * f)
|
||||||
fscanf(F, "%d ", &gid);
|
fscanf(F, "%d ", &gid);
|
||||||
if (!gid) break;
|
if (!gid) break;
|
||||||
rsf(F, buf, sizeof(buf));
|
rsf(F, buf, sizeof(buf));
|
||||||
g = new_group(f, buf, gid);
|
g = new_group(f, (const xmlChar *)buf, gid);
|
||||||
pa = &g->allies;
|
pa = &g->allies;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
ally * a;
|
ally * a;
|
||||||
|
|
|
@ -395,7 +395,7 @@ it_alias(const char * zname)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i=0;it_aliases[i][0];++i) {
|
for (i=0;it_aliases[i][0];++i) {
|
||||||
if (strcasecmp(it_aliases[i][0], zname)==0) return it_aliases[i][1];
|
if (strcmp(it_aliases[i][0], zname)==0) return it_aliases[i][1];
|
||||||
}
|
}
|
||||||
return zname;
|
return zname;
|
||||||
}
|
}
|
||||||
|
|
|
@ -920,11 +920,10 @@ cycle_route(order * ord, unit *u, int gereist)
|
||||||
if (get_keyword(ord) != K_ROUTE) return;
|
if (get_keyword(ord) != K_ROUTE) return;
|
||||||
tail[0] = '\0';
|
tail[0] = '\0';
|
||||||
|
|
||||||
xmlStrcpy(neworder, locale_string(u->faction->locale, keywords[K_ROUTE]));
|
|
||||||
|
|
||||||
init_tokens(ord);
|
init_tokens(ord);
|
||||||
skip_token();
|
skip_token();
|
||||||
|
|
||||||
|
neworder[0]=0;
|
||||||
for (cm=0;;++cm) {
|
for (cm=0;;++cm) {
|
||||||
const struct locale * lang = u->faction->locale;
|
const struct locale * lang = u->faction->locale;
|
||||||
pause = false;
|
pause = false;
|
||||||
|
@ -966,7 +965,7 @@ cycle_route(order * ord, unit *u, int gereist)
|
||||||
}
|
}
|
||||||
|
|
||||||
strcat((char *)neworder, (const char *)tail);
|
strcat((char *)neworder, (const char *)tail);
|
||||||
norder = parse_order(neworder, u->faction->locale);
|
norder = create_order(K_ROUTE, u->faction->locale, "%s", neworder);
|
||||||
#ifdef LASTORDER
|
#ifdef LASTORDER
|
||||||
set_order(&u->lastorder, norder);
|
set_order(&u->lastorder, norder);
|
||||||
#else
|
#else
|
||||||
|
@ -1485,7 +1484,6 @@ travel_route(unit * u, region_list * route_begin, region_list * route_end, order
|
||||||
/* the unit has moved at least one region */
|
/* the unit has moved at least one region */
|
||||||
int walkmode;
|
int walkmode;
|
||||||
region_list **rlist = &route_begin;
|
region_list **rlist = &route_begin;
|
||||||
region * next = r;
|
|
||||||
|
|
||||||
setguard(u, GUARD_NONE);
|
setguard(u, GUARD_NONE);
|
||||||
cycle_route(ord, u, steps);
|
cycle_route(ord, u, steps);
|
||||||
|
@ -1502,12 +1500,7 @@ travel_route(unit * u, region_list * route_begin, region_list * route_end, order
|
||||||
/* Berichte über Durchreiseregionen */
|
/* Berichte über Durchreiseregionen */
|
||||||
|
|
||||||
while (*rlist!=iroute) {
|
while (*rlist!=iroute) {
|
||||||
if (next!=u->region && next!=current) {
|
rlist = &(*rlist)->next;
|
||||||
MSG(("travelthru_trail", "region", next),
|
|
||||||
p, sizeof(buf) - (p-buf), u->faction->locale, u->faction);
|
|
||||||
}
|
|
||||||
next = rlist->data;
|
|
||||||
rlist = rlist->next;
|
|
||||||
}
|
}
|
||||||
/* remove excess regions */
|
/* remove excess regions */
|
||||||
*rlist = NULL;
|
*rlist = NULL;
|
||||||
|
@ -1538,10 +1531,8 @@ ship_ready(const region * r, unit * u)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (eff_skill(u, SK_SAILING, r) < u->ship->type->cptskill) {
|
if (eff_skill(u, SK_SAILING, r) < u->ship->type->cptskill) {
|
||||||
sprintf(buf, "Der Kapitän muß mindestens Segeln %d haben, "
|
ADDMSG(&u->faction->msgs, msg_feedback(u, u->thisorder, "error_captain_skill_low",
|
||||||
"um %s zu befehligen ", u->ship->type->cptskill,
|
"value ship", u->ship->type->cptskill, u->ship));
|
||||||
LOC(u->faction->locale, u->ship->type->name[1]));
|
|
||||||
mistake(u, u->thisorder, buf, MSG_MOVE);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
assert(u->ship->type->construction->improvement == NULL); /* sonst ist construction::size nicht ship_type::maxsize */
|
assert(u->ship->type->construction->improvement == NULL); /* sonst ist construction::size nicht ship_type::maxsize */
|
||||||
|
@ -1855,7 +1846,6 @@ sail(unit * u, order * ord, boolean move_on_land, region_list **routep)
|
||||||
if (sh && hafenmeister != NULL) {
|
if (sh && hafenmeister != NULL) {
|
||||||
item * itm;
|
item * itm;
|
||||||
unit * u2;
|
unit * u2;
|
||||||
boolean first = true;
|
|
||||||
item * trans = NULL;
|
item * trans = NULL;
|
||||||
|
|
||||||
for (u2 = current_point->units; u2; u2 = u2->next) {
|
for (u2 = current_point->units; u2; u2 = u2->next) {
|
||||||
|
@ -1881,29 +1871,10 @@ sail(unit * u, order * ord, boolean move_on_land, region_list **routep)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (trans) {
|
if (trans) {
|
||||||
sprintf(buf, "%s erhielt ", hafenmeister->name);
|
message * msg = msg_message("harbor_trade", "unit items ship", hafenmeister, trans, u->ship);
|
||||||
for (itm = trans; itm; itm=itm->next) {
|
add_message(&u->faction->msgs, msg);
|
||||||
if (!first) {
|
add_message(&hafenmeister->faction->msgs, msg);
|
||||||
if (itm->next!=NULL && itm->next->next == NULL) {
|
msg_release(msg);
|
||||||
scat(" und ");
|
|
||||||
} else {
|
|
||||||
scat(", ");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
first = false;
|
|
||||||
icat(trans->number);
|
|
||||||
scat(" ");
|
|
||||||
if (itm->number == 1) {
|
|
||||||
scat(locale_string(default_locale, resourcename(itm->type->rtype, 0)));
|
|
||||||
} else {
|
|
||||||
scat(locale_string(default_locale, resourcename(itm->type->rtype, NMF_PLURAL)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
scat(" von der ");
|
|
||||||
scat(shipname(u->ship));
|
|
||||||
scat(".");
|
|
||||||
addmessage(0, u->faction, buf, MSG_COMMERCE, ML_INFO);
|
|
||||||
addmessage(0, hafenmeister->faction, buf, MSG_INCOME, ML_INFO);
|
|
||||||
while (trans) i_remove(&trans, trans);
|
while (trans) i_remove(&trans, trans);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2146,7 +2117,7 @@ piracy_cmd(unit *u, struct order * ord)
|
||||||
} aff[MAXDIRECTIONS];
|
} aff[MAXDIRECTIONS];
|
||||||
int saff = 0;
|
int saff = 0;
|
||||||
int *il = NULL;
|
int *il = NULL;
|
||||||
const char *s;
|
const xmlChar *s;
|
||||||
attrib *a;
|
attrib *a;
|
||||||
|
|
||||||
if (!sh) {
|
if (!sh) {
|
||||||
|
@ -2169,7 +2140,7 @@ piracy_cmd(unit *u, struct order * ord)
|
||||||
if (s!=NULL && *s) {
|
if (s!=NULL && *s) {
|
||||||
il = intlist_init();
|
il = intlist_init();
|
||||||
while (s && *s) {
|
while (s && *s) {
|
||||||
il = intlist_add(il, atoi36(s));
|
il = intlist_add(il, atoi36((const char *)s));
|
||||||
s = getstrtoken();
|
s = getstrtoken();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2291,7 +2262,8 @@ hunt(unit *u, order * ord)
|
||||||
{
|
{
|
||||||
region *rc = u->region;
|
region *rc = u->region;
|
||||||
int moves, id, speed;
|
int moves, id, speed;
|
||||||
char command[256];
|
xmlChar command[256];
|
||||||
|
size_t size = sizeof(command);
|
||||||
direction_t dir;
|
direction_t dir;
|
||||||
|
|
||||||
if (fval(u, UFL_NOTMOVING)) {
|
if (fval(u, UFL_NOTMOVING)) {
|
||||||
|
@ -2329,8 +2301,9 @@ hunt(unit *u, order * ord)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(command, "%s %s", locale_string(u->faction->locale, keywords[K_MOVE]),
|
sprintf((char *)command, "%s %s", locale_string(u->faction->locale, keywords[K_MOVE]),
|
||||||
locale_string(u->faction->locale, directions[dir]));
|
locale_string(u->faction->locale, directions[dir]));
|
||||||
|
size -= xstrlen(command);
|
||||||
moves = 1;
|
moves = 1;
|
||||||
|
|
||||||
speed = getuint();
|
speed = getuint();
|
||||||
|
@ -2343,8 +2316,8 @@ hunt(unit *u, order * ord)
|
||||||
rc = rconnect(rc, dir);
|
rc = rconnect(rc, dir);
|
||||||
while (moves < speed && (dir = hunted_dir(rc->attribs, id)) != NODIRECTION)
|
while (moves < speed && (dir = hunted_dir(rc->attribs, id)) != NODIRECTION)
|
||||||
{
|
{
|
||||||
strcat(command, " ");
|
size -= xstrlcat(command, " ", size);
|
||||||
strcat(command, locale_string(u->faction->locale, directions[dir]));
|
size -= xstrlcat(command, LOC(u->faction->locale, directions[dir]), size);
|
||||||
moves++;
|
moves++;
|
||||||
rc = rconnect(rc, dir);
|
rc = rconnect(rc, dir);
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ getplanebyname(const char * name)
|
||||||
plane *p;
|
plane *p;
|
||||||
|
|
||||||
for (p=planes; p; p=p->next)
|
for (p=planes; p; p=p->next)
|
||||||
if (!strcasecmp(p->name, name))
|
if (!strcmp(p->name, name))
|
||||||
return p;
|
return p;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ const ship_type *
|
||||||
st_find(const char* name)
|
st_find(const char* name)
|
||||||
{
|
{
|
||||||
const struct ship_typelist * stl = shiptypes;
|
const struct ship_typelist * stl = shiptypes;
|
||||||
while (stl && strcasecmp(stl->type->name[0], name)) stl = stl->next;
|
while (stl && strcmp(stl->type->name[0], name)) stl = stl->next;
|
||||||
return stl?stl->type:NULL;
|
return stl?stl->type:NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,11 +46,6 @@ spell_list * spells = NULL;
|
||||||
void
|
void
|
||||||
register_spell(spell * sp)
|
register_spell(spell * sp)
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
|
||||||
const char * name = mkname("spell", sp->sname);
|
|
||||||
assert(name!=LOC(default_locale, name));
|
|
||||||
assert(strchr(sp->sname, ' ')==NULL);
|
|
||||||
#endif
|
|
||||||
if (sp->id==0) {
|
if (sp->id==0) {
|
||||||
sp->id = hashstring(sp->sname);
|
sp->id = hashstring(sp->sname);
|
||||||
}
|
}
|
||||||
|
@ -102,7 +97,7 @@ init_spellnames(const struct locale * lang, magic_t mtype)
|
||||||
for (slist=spells;slist!=NULL;slist=slist->next) {
|
for (slist=spells;slist!=NULL;slist=slist->next) {
|
||||||
spell * sp = slist->data;
|
spell * sp = slist->data;
|
||||||
if (sp->magietyp==mtype) {
|
if (sp->magietyp==mtype) {
|
||||||
const char * n = spell_name(sp, lang);
|
const xmlChar * n = spell_name(sp, lang);
|
||||||
variant token;
|
variant token;
|
||||||
token.v = sp;
|
token.v = sp;
|
||||||
addtoken(&sn->names, n, token);
|
addtoken(&sn->names, n, token);
|
||||||
|
|
|
@ -257,9 +257,11 @@ extern char * strdup(const char *s);
|
||||||
|
|
||||||
#define xstrlen(a) strlen((const char*)(a))
|
#define xstrlen(a) strlen((const char*)(a))
|
||||||
#define xstrcmp(a, b) strcmp((const char*)(a), (const char *)(b))
|
#define xstrcmp(a, b) strcmp((const char*)(a), (const char *)(b))
|
||||||
|
#define xstrcat(a, b) (xmlChar *)strcat((char*)(a), (const char *)(b))
|
||||||
#define xstrncmp(a, b, s) strncmp((const char*)(a), (const char *)(b), s)
|
#define xstrncmp(a, b, s) strncmp((const char*)(a), (const char *)(b), s)
|
||||||
#define xstrdup(a) (xmlChar *)strdup((const char*)(a))
|
#define xstrdup(a) (xmlChar *)strdup((const char*)(a))
|
||||||
#define xstrlcpy(a, b, s) strlcpy((char*)(a), (const char*)(b), s)
|
#define xstrlcpy(a, b, s) strlcpy((char*)(a), (const char*)(b), s)
|
||||||
|
#define xstrlcat(a, b, s) strlcat((char*)(a), (const char *)(b), s)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -7702,6 +7702,38 @@
|
||||||
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - $unit($target) does not understand our kind of magic."</text>
|
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - $unit($target) does not understand our kind of magic."</text>
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
|
<message name="error_captain_skill_low" section="errors">
|
||||||
|
<type>
|
||||||
|
<arg name="region" type="region"/>
|
||||||
|
<arg name="unit" type="unit"/>
|
||||||
|
<arg name="command" type="order"/>
|
||||||
|
<arg name="value" type="int"/>
|
||||||
|
<arg name="ship" type="ship"/>
|
||||||
|
</type>
|
||||||
|
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Der Kapitän muß ein Segeltalent von mindestens $int($value) haben, um $ship($ship) zu befehligen."</text>
|
||||||
|
</message>
|
||||||
|
|
||||||
|
<message name="error_roads_finished" section="errors">
|
||||||
|
<type>
|
||||||
|
<arg name="region" type="region"/>
|
||||||
|
<arg name="unit" type="unit"/>
|
||||||
|
<arg name="command" type="order"/>
|
||||||
|
</type>
|
||||||
|
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - In dieser Region gibt es keine Brücken uns Straßen mehr zu bauen."</text>
|
||||||
|
</message>
|
||||||
|
|
||||||
|
<message name="error_build_skill_low" section="errors">
|
||||||
|
<type>
|
||||||
|
<arg name="region" type="region"/>
|
||||||
|
<arg name="unit" type="unit"/>
|
||||||
|
<arg name="command" type="order"/>
|
||||||
|
<arg name="value" type="int"/>
|
||||||
|
<arg name="name" type="string"/>
|
||||||
|
</type>
|
||||||
|
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Um $localize($name) zu bauen, braucht man ein Talent von mindestens $int($value)."</text>
|
||||||
|
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - To build $localize($name) requires a skill of at least $int($value)."</text>
|
||||||
|
</message>
|
||||||
|
|
||||||
<message name="slave_active" section="battle">
|
<message name="slave_active" section="battle">
|
||||||
<type>
|
<type>
|
||||||
<arg name="region" type="region"/>
|
<arg name="region" type="region"/>
|
||||||
|
@ -7712,4 +7744,14 @@
|
||||||
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - This unit will not fight."</text>
|
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - This unit will not fight."</text>
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
|
<message name="harbor_trade" section="events">
|
||||||
|
<type>
|
||||||
|
<arg name="unit" type="unit"/>
|
||||||
|
<arg name="items" type="items"/>
|
||||||
|
<arg name="ship" type="ship"/>
|
||||||
|
</type>
|
||||||
|
<text locale="de">"$unit($unit) erhielt $resources($items) von der $ship($ship)."</text>
|
||||||
|
<text locale="en">"$unit($unit) received $resources($items) from the $ship($ship)."</text>
|
||||||
|
</message>
|
||||||
|
|
||||||
</messages>
|
</messages>
|
||||||
|
|
Loading…
Reference in New Issue