misc core formatting

Some of these are post-3.6.0, some just got overlooked before the
3.6.0 release.
This commit is contained in:
PatR
2016-05-14 18:26:48 -07:00
parent 0a15d425a8
commit 26226a1cdb
6 changed files with 33 additions and 31 deletions

View File

@@ -952,8 +952,8 @@ int how;
return;
}
}
if ((wizard || discover) && (how <= GENOCIDED) &&
!paranoid_query(ParanoidDie, "Die?")) {
if ((wizard || discover) && (how <= GENOCIDED)
&& !paranoid_query(ParanoidDie, "Die?")) {
pline("OK, so you don't %s.", (how == CHOKING) ? "choke" : "die");
savelife(how);
killer.name[0] = 0;

View File

@@ -2383,8 +2383,9 @@ struct monst *mtmp;
SUPPRESS_SADDLE | SUPPRESS_HALLUCINATION
| SUPPRESS_INVISIBLE | SUPPRESS_IT,
FALSE),
amorphous(mtmp->data) ? "coalesces on the" :
is_flyer(mtmp->data) ? "drops to the" : "writhes on the",
amorphous(mtmp->data) ? "coalesces on the"
: is_flyer(mtmp->data) ? "drops to the"
: "writhes on the",
surface(x,y));
mtmp->mcanmove = 1;
mtmp->mfrozen = 0;

View File

@@ -526,10 +526,9 @@ boolean user_typed_name, without_asking;
/*
* If the object is named, then the name is the alternate description;
* otherwise, the result of makesingular() applied to the name is.
* This
* isn't strictly optimal, but named objects of interest to the user
* will usually be found under their name, rather than under their
* object type, so looking for a singular form is pointless.
* This isn't strictly optimal, but named objects of interest to the
* user will usually be found under their name, rather than under
* their object type, so looking for a singular form is pointless.
*/
if (!alt)
alt = makesingular(dbase_str);
@@ -565,10 +564,11 @@ boolean user_typed_name, without_asking;
if (!(ep = index(buf, '\n')))
goto bad_data_file;
(void) strip_newline((ep > buf) ? ep - 1 : ep);
/* if we match a key that begins with "~", skip this entry */
/* if we match a key that begins with "~", skip
this entry */
chk_skip = (*buf == '~') ? 1 : 0;
if ((pass == 0 && pmatch(&buf[chk_skip], dbase_str)) ||
(pass == 1 && alt && pmatch(&buf[chk_skip], alt))) {
if ((pass == 0 && pmatch(&buf[chk_skip], dbase_str))
|| (pass == 1 && alt && pmatch(&buf[chk_skip], alt))) {
if (chk_skip) {
skipping_entry = TRUE;
continue;
@@ -592,7 +592,7 @@ boolean user_typed_name, without_asking;
if (sscanf(buf, "%ld,%d\n", &entry_offset, &entry_count) < 2) {
bad_data_file:
impossible("'data' file in wrong format or corrupted");
/* window will exist if we came here from below via 'goto' */
/* window will exist if came here from below via 'goto' */
if (datawin != WIN_ERR)
destroy_nhwindow(datawin);
(void) dlb_fclose(fp);
@@ -604,6 +604,7 @@ boolean user_typed_name, without_asking;
unsigned maxt = strlen("More info about \"\"?");
char *entrytext = pass ? alt : dbase_str;
char question[BUFSZ];
if (strlen(entrytext) < BUFSZ - maxt) {
Strcpy(question, "More info about \"");
Strcat(question, entrytext);
@@ -614,8 +615,8 @@ boolean user_typed_name, without_asking;
}
if (user_typed_name || without_asking || yes_to_moreinfo) {
if (dlb_fseek(fp,
(long) txt_offset + entry_offset, SEEK_SET) < 0) {
if (dlb_fseek(fp, (long) txt_offset + entry_offset,
SEEK_SET) < 0) {
pline("? Seek error on 'data' file!");
(void) dlb_fclose(fp);
return;

View File

@@ -1839,8 +1839,8 @@ reverse_loot()
boxdummy = zeroobj, boxdummy.otyp = SPE_WIZARD_LOCK;
(void) boxlock(coffers, &boxdummy);
}
} else if (levl[x][y].looted != T_LOOTED &&
(mon = makemon(courtmon(), x, y, NO_MM_FLAGS)) != 0) {
} else if (levl[x][y].looted != T_LOOTED
&& (mon = makemon(courtmon(), x, y, NO_MM_FLAGS)) != 0) {
freeinv(goldob);
add_to_minv(mon, goldob);
pline("The exchequer accepts your contribution.");

View File

@@ -377,8 +377,8 @@ invault()
}
trycount = 5;
do {
getlin(Deaf ? "You are required to supply your name. -" :
"\"Hello stranger, who are you?\" -", buf);
getlin(Deaf ? "You are required to supply your name. -"
: "\"Hello stranger, who are you?\" -", buf);
(void) mungspaces(buf);
} while (!buf[0] && --trycount > 0);

View File

@@ -577,9 +577,9 @@ coord *cc;
if (mtmp->m_id) {
mtmp2->m_id = mtmp->m_id;
/* might be bringing quest leader back to life */
if (quest_status.leader_is_dead &&
if (quest_status.leader_is_dead
/* leader_is_dead implies leader_m_id is valid */
mtmp2->m_id == quest_status.leader_m_id)
&& mtmp2->m_id == quest_status.leader_m_id)
quest_status.leader_is_dead = FALSE;
}
mtmp2->mx = mtmp->mx;
@@ -708,16 +708,16 @@ boolean by_hero;
break; /* x,y are 0 */
}
}
if (!x || !y ||
if (!x || !y
/* Rules for revival from containers:
- the container cannot be locked
- the container cannot be heavily nested (>2 is arbitrary)
- the container cannot be a statue or bag of holding
(except in very rare cases for the latter)
*/
(container && (container->olocked || container_nesting > 2
|| container->otyp == STATUE
|| (container->otyp == BAG_OF_HOLDING && rn2(40)))))
* - the container cannot be locked
* - the container cannot be heavily nested (>2 is arbitrary)
* - the container cannot be a statue or bag of holding
* (except in very rare cases for the latter)
*/
|| (container && (container->olocked || container_nesting > 2
|| container->otyp == STATUE
|| (container->otyp == BAG_OF_HOLDING && rn2(40)))))
return (struct monst *) 0;
/* record the object's location now that we're sure where it is */
@@ -2695,10 +2695,10 @@ struct obj *obj; /* wand or spell */
if (is_db_wall(x, y) && find_drawbridge(&xx, &yy)) {
open_drawbridge(xx, yy);
disclose = TRUE;
} else if (u.dz > 0 && (x == xdnstair && y == ydnstair) &&
} else if (u.dz > 0 && (x == xdnstair && y == ydnstair)
/* can't use the stairs down to quest level 2 until
leader "unlocks" them; give feedback if you try */
on_level(&u.uz, &qstart_level) && !ok_to_quest()) {
&& on_level(&u.uz, &qstart_level) && !ok_to_quest()) {
pline_The("stairs seem to ripple momentarily.");
disclose = TRUE;
}