forked from github/server
bugfixes eressea-compilierbarkeit
This commit is contained in:
parent
4e54590d98
commit
b53a5cc7d1
|
@ -1231,7 +1231,7 @@ quit(void)
|
||||||
age = calloc(turn+1, sizeof(int));
|
age = calloc(turn+1, sizeof(int));
|
||||||
for (f = factions; f; f = f->next) if (f->no != MONSTER_FACTION) {
|
for (f = factions; f; f = f->next) if (f->no != MONSTER_FACTION) {
|
||||||
#if REMOVENMRNEWBIE
|
#if REMOVENMRNEWBIE
|
||||||
if(!fval(f, FL_NOIDLEOUT) && f!=) {
|
if(!fval(f, FL_NOIDLEOUT)) {
|
||||||
if (f->age>=0 && f->age <= turn) ++age[f->age];
|
if (f->age>=0 && f->age <= turn) ++age[f->age];
|
||||||
if (f->age == 2 || f->age == 3) {
|
if (f->age == 2 || f->age == 3) {
|
||||||
if (f->lastorders == turn - 2) {
|
if (f->lastorders == turn - 2) {
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <eressea.h>
|
#include <eressea.h>
|
||||||
#include "alliance.h"
|
#include "alliance.h"
|
||||||
|
#ifdef ALLIANCES
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
|
|
||||||
/* kernel includes */
|
/* kernel includes */
|
||||||
|
@ -275,3 +276,4 @@ alliancevictory(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
* This program may not be used, modified or distributed without
|
* This program may not be used, modified or distributed without
|
||||||
* prior permission by the authors of Eressea.
|
* prior permission by the authors of Eressea.
|
||||||
*/
|
*/
|
||||||
|
#ifdef ALLIANCES
|
||||||
struct plane;
|
struct plane;
|
||||||
struct attrib;
|
struct attrib;
|
||||||
struct unit;
|
struct unit;
|
||||||
|
@ -38,3 +38,4 @@ extern void alliancekick(void);
|
||||||
extern void alliancevictory(void);
|
extern void alliancevictory(void);
|
||||||
/* execute commands */
|
/* execute commands */
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -340,13 +340,12 @@ allysfm(const side * s, const faction * f, int mode)
|
||||||
return alliedfaction(s->battle->plane, s->bf->faction, f, mode);
|
return alliedfaction(s->battle->plane, s->bf->faction, f, mode);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
extern int alliance(const ally * sf, const faction * f, int mode);
|
|
||||||
static int
|
static int
|
||||||
allysfm(const side * s, const faction * f, int mode)
|
allysfm(const side * s, const faction * f, int mode)
|
||||||
{
|
{
|
||||||
if (s->bf->faction==f) return true;
|
if (s->bf->faction==f) return true;
|
||||||
if (s->group) return alliance(s->group->allies, f, mode);
|
if (s->group) return alliedgroup(s->battle->plane, s->bf->faction, s->group->allies, f, mode);
|
||||||
return alliance(s->bf->faction->allies, f, mode);
|
return alliedfaction(s->battle->plane, s->bf->faction, f, mode);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -726,17 +726,6 @@ unit_has_cursed_item(unit *u)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
alliance(const ally * sf, const faction * f, int mode)
|
|
||||||
{
|
|
||||||
while (sf) {
|
|
||||||
if (sf->faction == f)
|
|
||||||
return sf->status & mode;
|
|
||||||
sf = sf->next;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
autoalliance(const plane * pl, const faction * sf, const faction * f2)
|
autoalliance(const plane * pl, const faction * sf, const faction * f2)
|
||||||
{
|
{
|
||||||
|
@ -757,13 +746,33 @@ autoalliance(const plane * pl, const faction * sf, const faction * f2)
|
||||||
return mode;
|
return mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
alliance(const ally * sf, const faction * f, int mode)
|
||||||
|
{
|
||||||
|
int nmode = 0;
|
||||||
|
while (sf) {
|
||||||
|
if (sf->faction == f) {
|
||||||
|
nmode = sf->status & mode;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
sf = sf->next;
|
||||||
|
}
|
||||||
|
return nmode;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
alliedgroup(const struct plane * pl, const struct faction * f, const struct ally * sf, const struct faction * f2, int mode)
|
||||||
|
{
|
||||||
|
return alliance(sf, f, mode) | (mode & autoalliance(pl, f, f2));
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
alliedfaction(const struct plane * pl, const faction * sf, const faction * f2, int mode)
|
alliedfaction(const struct plane * pl, const faction * sf, const faction * f2, int mode)
|
||||||
{
|
{
|
||||||
#ifdef ALLIANCES
|
#ifdef ALLIANCES
|
||||||
if (sf->alliance!=f2->alliance) return 0;
|
if (sf->alliance!=f2->alliance) return 0;
|
||||||
#endif
|
#endif
|
||||||
return alliance(sf->allies, f2, mode) | (mode & autoalliance(pl, sf, f2));
|
return alliedgroup(pl, sf, sf->allies, f2, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Die Gruppe von Einheit u hat helfe zu f2 gesetzt. */
|
/* Die Gruppe von Einheit u hat helfe zu f2 gesetzt. */
|
||||||
|
@ -786,7 +795,7 @@ alliedunit(const unit * u, const faction * f2, int mode)
|
||||||
sf = u->faction->allies;
|
sf = u->faction->allies;
|
||||||
a = a_find(u->attribs, &at_group);
|
a = a_find(u->attribs, &at_group);
|
||||||
if (a!=NULL) sf = ((group*)a->data.v)->allies;
|
if (a!=NULL) sf = ((group*)a->data.v)->allies;
|
||||||
return alliance(sf, f2, mode) | automode;
|
return alliance(sf, f2, mode) | (mode & autoalliance(pl, u->faction, f2));
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean
|
boolean
|
||||||
|
|
|
@ -1017,6 +1017,7 @@ int read_unitid(const struct faction * f, const struct region * r);
|
||||||
|
|
||||||
extern int alliedunit(const struct unit * u, const struct faction * f2, int mode);
|
extern int alliedunit(const struct unit * u, const struct faction * f2, int mode);
|
||||||
extern int alliedfaction(const struct plane * pl, const struct faction * f, const struct faction * f2, int mode);
|
extern int alliedfaction(const struct plane * pl, const struct faction * f, const struct faction * f2, int mode);
|
||||||
|
extern int alliedgroup(const struct plane * pl, const struct faction * f, const struct ally * sf, const struct faction * f2, int mode);
|
||||||
|
|
||||||
struct faction *findfaction(int n);
|
struct faction *findfaction(int n);
|
||||||
struct faction *findfaction_unique_id(int unique_id);
|
struct faction *findfaction_unique_id(int unique_id);
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <eressea.h>
|
#include <eressea.h>
|
||||||
#include "alliance.h"
|
#include "alliance.h"
|
||||||
|
#ifdef ALLIANCES
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
|
|
||||||
/* kernel includes */
|
/* kernel includes */
|
||||||
|
@ -275,3 +276,4 @@ alliancevictory(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
* This program may not be used, modified or distributed without
|
* This program may not be used, modified or distributed without
|
||||||
* prior permission by the authors of Eressea.
|
* prior permission by the authors of Eressea.
|
||||||
*/
|
*/
|
||||||
|
#ifdef ALLIANCES
|
||||||
struct plane;
|
struct plane;
|
||||||
struct attrib;
|
struct attrib;
|
||||||
struct unit;
|
struct unit;
|
||||||
|
@ -38,3 +38,4 @@ extern void alliancekick(void);
|
||||||
extern void alliancevictory(void);
|
extern void alliancevictory(void);
|
||||||
/* execute commands */
|
/* execute commands */
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -452,8 +452,8 @@ NeuePartei(region * r)
|
||||||
}
|
}
|
||||||
i = 0; q = 0; y++;
|
i = 0; q = 0; y++;
|
||||||
wmove(win, y, 4);
|
wmove(win, y, 4);
|
||||||
while(locales[i] != NULL) {
|
while(localenames[i] != NULL) {
|
||||||
sprintf(buf, "%d=%s; ", i, locales[i]);
|
sprintf(buf, "%d=%s; ", i, localenames[i]);
|
||||||
q += strlen(buf);
|
q += strlen(buf);
|
||||||
if (q > SX - 20) {
|
if (q > SX - 20) {
|
||||||
q = strlen(buf);
|
q = strlen(buf);
|
||||||
|
@ -471,7 +471,7 @@ NeuePartei(region * r)
|
||||||
delwin(win);
|
delwin(win);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
lang = find_locale(locales[locale_nr]);
|
lang = find_locale(localenames[locale_nr]);
|
||||||
|
|
||||||
delwin(win);
|
delwin(win);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue