forked from github/server
Merge branch 'master' of github.com:eressea/server
This commit is contained in:
commit
2fe40f00f5
4 changed files with 28 additions and 21 deletions
|
@ -1,3 +1,3 @@
|
||||||
#define VERSION_MAJOR 3
|
#define VERSION_MAJOR 3
|
||||||
#define VERSION_MINOR 4
|
#define VERSION_MINOR 4
|
||||||
#define VERSION_BUILD 689
|
#define VERSION_BUILD 691
|
||||||
|
|
|
@ -1488,11 +1488,11 @@ static void create_item(unit * u, const item_type * itype, int want)
|
||||||
int make_cmd(unit * u, struct order *ord)
|
int make_cmd(unit * u, struct order *ord)
|
||||||
{
|
{
|
||||||
region *r = u->region;
|
region *r = u->region;
|
||||||
const building_type *btype;
|
const building_type *btype = 0;
|
||||||
const ship_type *stype;
|
const ship_type *stype = 0;
|
||||||
param_t p;
|
const item_type *itype = 0;
|
||||||
int m;
|
param_t p = NOPARAM;
|
||||||
const item_type *itype;
|
int m = INT_MAX;
|
||||||
const char *s;
|
const char *s;
|
||||||
const struct locale *lang = u->faction->locale;
|
const struct locale *lang = u->faction->locale;
|
||||||
char ibuf[16];
|
char ibuf[16];
|
||||||
|
@ -1502,17 +1502,19 @@ int make_cmd(unit * u, struct order *ord)
|
||||||
assert(kwd == K_MAKE);
|
assert(kwd == K_MAKE);
|
||||||
s = getstrtoken();
|
s = getstrtoken();
|
||||||
|
|
||||||
m = atoi((const char *)s);
|
if (s) {
|
||||||
sprintf(ibuf, "%d", m);
|
m = atoi((const char *)s);
|
||||||
if (!strcmp(ibuf, (const char *)s)) {
|
sprintf(ibuf, "%d", m);
|
||||||
/* first came a want-paramter */
|
if (!strcmp(ibuf, (const char *)s)) {
|
||||||
s = getstrtoken();
|
/* a quantity was given */
|
||||||
|
s = getstrtoken();
|
||||||
|
} else {
|
||||||
|
m = INT_MAX;
|
||||||
|
}
|
||||||
|
if (s) {
|
||||||
|
p = findparam(s, u->faction->locale);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
m = INT_MAX;
|
|
||||||
}
|
|
||||||
|
|
||||||
p = findparam(s, u->faction->locale);
|
|
||||||
|
|
||||||
if (p == P_ROAD) {
|
if (p == P_ROAD) {
|
||||||
plane *pl = rplane(r);
|
plane *pl = rplane(r);
|
||||||
|
@ -1551,10 +1553,11 @@ int make_cmd(unit * u, struct order *ord)
|
||||||
* 'academy of arts', we need to figure out what the player meant.
|
* 'academy of arts', we need to figure out what the player meant.
|
||||||
* This is not 100% safe.
|
* This is not 100% safe.
|
||||||
*/
|
*/
|
||||||
stype = findshiptype(s, lang);
|
if (s) {
|
||||||
btype = findbuildingtype(s, lang);
|
stype = findshiptype(s, lang);
|
||||||
itype = finditemtype(s, lang);
|
btype = findbuildingtype(s, lang);
|
||||||
|
itype = finditemtype(s, lang);
|
||||||
|
}
|
||||||
if (itype != NULL && (btype != NULL || stype != NULL)) {
|
if (itype != NULL && (btype != NULL || stype != NULL)) {
|
||||||
if (itype->construction == NULL) {
|
if (itype->construction == NULL) {
|
||||||
/* if the item cannot be made, we probably didn't mean to make it */
|
/* if the item cannot be made, we probably didn't mean to make it */
|
||||||
|
|
|
@ -2580,7 +2580,7 @@ static castorder *cast_cmd(unit * u, order * ord)
|
||||||
}
|
}
|
||||||
s = getstrtoken();
|
s = getstrtoken();
|
||||||
}
|
}
|
||||||
if (!s[0] || strlen(s) == 0) {
|
if (!s || !s[0] || strlen(s) == 0) {
|
||||||
/* Fehler "Es wurde kein Zauber angegeben" */
|
/* Fehler "Es wurde kein Zauber angegeben" */
|
||||||
cmistake(u, ord, 172, MSG_MAGIC);
|
cmistake(u, ord, 172, MSG_MAGIC);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -914,6 +914,8 @@ static unit *bewegung_blockiert_von(unit * reisender, region * r)
|
||||||
int sk = eff_skill(u, SK_PERCEPTION, r);
|
int sk = eff_skill(u, SK_PERCEPTION, r);
|
||||||
if (invisible(reisender, u) >= reisender->number)
|
if (invisible(reisender, u) >= reisender->number)
|
||||||
continue;
|
continue;
|
||||||
|
if (!(u_race(u)->flags & RCF_FLY) && u_race(reisender)->flags & RCF_FLY)
|
||||||
|
continue;
|
||||||
if ((u->faction == reisender->faction) || (ucontact(u, reisender)) || (alliedunit(u, reisender->faction, HELP_GUARD)))
|
if ((u->faction == reisender->faction) || (ucontact(u, reisender)) || (alliedunit(u, reisender->faction, HELP_GUARD)))
|
||||||
guard_count = guard_count - u->number;
|
guard_count = guard_count - u->number;
|
||||||
else if (sk >= stealth) {
|
else if (sk >= stealth) {
|
||||||
|
@ -963,6 +965,8 @@ static bool is_guardian_u(const unit * guard, unit * u, unsigned int mask)
|
||||||
return false;
|
return false;
|
||||||
if (!cansee(guard->faction, u->region, u, 0))
|
if (!cansee(guard->faction, u->region, u, 0))
|
||||||
return false;
|
return false;
|
||||||
|
if (!(u_race(guard)->flags & RCF_FLY) && u_race(u)->flags & RCF_FLY)
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue