forked from github/server
""rundenweise" Kampfzauber und Postkampfzauber werden zu Beginn des Kampfes ausgeführt/angezeigt" - order of uncategorized messages should be linear. - cleaning and speeding some code.
This commit is contained in:
parent
a79d40a91f
commit
7531de4645
5 changed files with 21 additions and 21 deletions
|
@ -520,7 +520,7 @@ render_messages(FILE * F, faction * f, message_list *msgs)
|
|||
#ifdef RENDER_CRMESSAGES
|
||||
char nrbuffer[1024*32];
|
||||
nrbuffer[0] = '\0';
|
||||
if (nr_render(m->msg, f->locale, nrbuffer, sizeof(nrbuffer), f)>0 && nrbuffer[0]) {
|
||||
if (nr_render(m->msg, f->locale, nrbuffer, sizeof(nrbuffer), f)>=0) {
|
||||
fprintf(F, "MESSAGE %u\n", messagehash(m->msg));
|
||||
fprintf(F, "%d;type\n", hash);
|
||||
fwritestr(F, nrbuffer);
|
||||
|
|
|
@ -179,7 +179,7 @@ rparagraph(FILE *F, const char *str, ptrdiff_t indent, int hanging_indent, char
|
|||
}
|
||||
begin = end = str;
|
||||
|
||||
while (*begin) {
|
||||
do {
|
||||
const char * last_space = begin;
|
||||
|
||||
if (mark && indent>=2) {
|
||||
|
@ -210,7 +210,7 @@ rparagraph(FILE *F, const char *str, ptrdiff_t indent, int hanging_indent, char
|
|||
}
|
||||
if (begin>end) begin = end;
|
||||
fputc('\n', F);
|
||||
}
|
||||
} while (*begin);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -700,7 +700,7 @@ rp_messages(FILE * F, message_list * msgs, faction * viewer, int indent, boolean
|
|||
struct mlist * m = msgs->begin;
|
||||
while (m) {
|
||||
/* messagetype * mt = m->type; */
|
||||
if (strcmp(nr_section(m->msg), section->name)==0) {
|
||||
if (!categorized || strcmp(nr_section(m->msg), section->name)==0) {
|
||||
char lbuf[8192];
|
||||
|
||||
if (!k && categorized) {
|
||||
|
@ -719,6 +719,7 @@ rp_messages(FILE * F, message_list * msgs, faction * viewer, int indent, boolean
|
|||
}
|
||||
m = m->next;
|
||||
}
|
||||
if (!categorized) break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ sideabkz(side *s, boolean truename)
|
|||
return sideabkz_buf;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
message_faction(battle * b, faction * f, struct message * m)
|
||||
{
|
||||
region * r = b->region;
|
||||
|
@ -1396,23 +1396,20 @@ fighters(battle *b, const side * vs, int minrow, int maxrow, int mask)
|
|||
|
||||
for (s = b->sides; s; s = s->next) {
|
||||
fighter *fig;
|
||||
|
||||
if (mask==FS_ENEMY) {
|
||||
if (!enemy(s, vs)) continue;
|
||||
} else if (mask==FS_HELP) {
|
||||
if (enemy(s, vs) || !allysf(s, vs->bf->faction)) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
assert(mask==(FS_HELP|FS_ENEMY) || !"invalid alliance state");
|
||||
}
|
||||
for (fig = s->fighters; fig; fig = fig->next) {
|
||||
int row = get_unitrow(fig, vs);
|
||||
if (row >= minrow && row <= maxrow) {
|
||||
switch (mask) {
|
||||
case FS_ENEMY:
|
||||
if (enemy(fig->side, vs)) cv_pushback(fightervp, fig);
|
||||
break;
|
||||
case FS_HELP:
|
||||
if (!enemy(fig->side, vs) && allysf(fig->side, vs->bf->faction))
|
||||
cv_pushback(fightervp, fig);
|
||||
break;
|
||||
case FS_HELP|FS_ENEMY:
|
||||
cv_pushback(fightervp, fig);
|
||||
break;
|
||||
default:
|
||||
assert(0 || !"Ungültiger Allianzstatus in fighters()");
|
||||
}
|
||||
cv_pushback(fightervp, fig);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -239,7 +239,6 @@ extern "C" {
|
|||
extern int count_enemies(struct battle * b, const struct fighter * af, int minrow, int maxrow, int select);
|
||||
extern boolean terminate(troop dt, troop at, int type, const char *damage, boolean missile);
|
||||
extern void message_all(battle * b, struct message * m);
|
||||
extern void message_faction(battle * b, struct faction * f, struct message * m);
|
||||
extern int hits(troop at, troop dt, weapon * awp);
|
||||
extern void damage_building(struct battle *b, struct building *bldg, int damage_abs);
|
||||
extern struct cvector * fighters(struct battle *b, const struct side * vs, int minrow, int maxrow, int mask);
|
||||
|
|
|
@ -370,7 +370,7 @@ sp_sleep(fighter * fi, int level, double power, spell * sp)
|
|||
dt = select_enemy(fi, FIGHT_ROW, BEHIND_ROW, SELECT_ADVANCE);
|
||||
assert(dt.fighter);
|
||||
du = dt.fighter->unit;
|
||||
if (is_magic_resistant(mage, du, 0) == false) {
|
||||
if (!is_magic_resistant(mage, du, 0)) {
|
||||
dt.fighter->person[dt.index].flags |= FL_SLEEPING;
|
||||
++k;
|
||||
--enemies;
|
||||
|
@ -810,6 +810,9 @@ sp_strong_wall(fighter * fi, int level, double power, spell * sp)
|
|||
return level;
|
||||
}
|
||||
|
||||
/** Spells: chaosrow / song of confusion.
|
||||
* German Title: 'Gesang der Verwirrung'
|
||||
*/
|
||||
int
|
||||
sp_chaosrow(fighter * fi, int level, double power, spell * sp)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue