Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2
This commit is contained in:
@@ -220,6 +220,8 @@ end of game while carrying Schroedinger's Box would reveal cat-or-corpse
|
|||||||
for inventory disclosure or put that info into dumplog, but not both
|
for inventory disclosure or put that info into dumplog, but not both
|
||||||
attempting to untrap an adjacent trap while on the edge of--not in--a pit
|
attempting to untrap an adjacent trap while on the edge of--not in--a pit
|
||||||
failed due to not being able to reach the floor
|
failed due to not being able to reach the floor
|
||||||
|
magic trap's deafening roar effect wasn't waking nearby monsters
|
||||||
|
scattering of objects might leave source location with wrong thing displayed
|
||||||
|
|
||||||
|
|
||||||
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
|
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
|
||||||
@@ -229,6 +231,8 @@ setting the inverse attribute for gold had the space before "$:"
|
|||||||
getting highlighted along with the gold field
|
getting highlighted along with the gold field
|
||||||
sortloot segfaulted when filtering a subset of items (seen with 'A' command)
|
sortloot segfaulted when filtering a subset of items (seen with 'A' command)
|
||||||
orctown: prevent Bad fruit #0 and some minor tuning
|
orctown: prevent Bad fruit #0 and some minor tuning
|
||||||
|
orctown: orcs beyond the mines were being given any left-over booty and named
|
||||||
|
as part of the same marauding gang operating within the mines
|
||||||
make long extended commands list be more navigable
|
make long extended commands list be more navigable
|
||||||
simplify #wizidentify; don't rely on having bold menu entries
|
simplify #wizidentify; don't rely on having bold menu entries
|
||||||
ensure tmp_at() structures are initialized for all code paths when swallowed
|
ensure tmp_at() structures are initialized for all code paths when swallowed
|
||||||
|
|||||||
+1
-1
@@ -431,7 +431,7 @@ E struct obj *FDECL(realloc_obj,
|
|||||||
(struct obj *, int, genericptr_t, int, const char *));
|
(struct obj *, int, genericptr_t, int, const char *));
|
||||||
E char *FDECL(coyotename, (struct monst *, char *));
|
E char *FDECL(coyotename, (struct monst *, char *));
|
||||||
E char *FDECL(rndorcname, (char *));
|
E char *FDECL(rndorcname, (char *));
|
||||||
E struct monst *FDECL(christen_orc, (struct monst *, char *));
|
E struct monst *FDECL(christen_orc, (struct monst *, char *, char *));
|
||||||
E const char *FDECL(noveltitle, (int *));
|
E const char *FDECL(noveltitle, (int *));
|
||||||
E const char *FDECL(lookup_novel, (const char *, int *));
|
E const char *FDECL(lookup_novel, (const char *, int *));
|
||||||
|
|
||||||
|
|||||||
+14
-4
@@ -2088,17 +2088,27 @@ char *s;
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct monst *
|
struct monst *
|
||||||
christen_orc(mtmp, gang)
|
christen_orc(mtmp, gang, other)
|
||||||
struct monst *mtmp;
|
struct monst *mtmp;
|
||||||
char *gang;
|
char *gang, *other;
|
||||||
{
|
{
|
||||||
int sz = 0;
|
int sz = 0;
|
||||||
char buf[BUFSZ], buf2[BUFSZ], *orcname;
|
char buf[BUFSZ], buf2[BUFSZ], *orcname;
|
||||||
|
|
||||||
orcname = rndorcname(buf2);
|
orcname = rndorcname(buf2);
|
||||||
sz = (int) (strlen(gang) + strlen(orcname) + sizeof " of " - sizeof "");
|
sz = (int) ((gang ? strlen(gang) : other ? strlen(other) : 0)
|
||||||
if (gang && orcname && sz < BUFSZ) {
|
+ strlen(orcname) + sizeof " of " - sizeof "");
|
||||||
|
if (sz < BUFSZ) {
|
||||||
|
boolean nameit = FALSE;
|
||||||
|
|
||||||
|
if (gang && orcname) {
|
||||||
Sprintf(buf, "%s of %s", upstart(orcname), upstart(gang));
|
Sprintf(buf, "%s of %s", upstart(orcname), upstart(gang));
|
||||||
|
nameit = TRUE;
|
||||||
|
} else if (other && orcname) {
|
||||||
|
Sprintf(buf, "%s%s", upstart(orcname), other);
|
||||||
|
nameit = TRUE;
|
||||||
|
}
|
||||||
|
if (nameit)
|
||||||
mtmp = christen_monst(mtmp, buf);
|
mtmp = christen_monst(mtmp, buf);
|
||||||
}
|
}
|
||||||
return mtmp;
|
return mtmp;
|
||||||
|
|||||||
+7
-2
@@ -1680,6 +1680,7 @@ unsigned long deliverflags;
|
|||||||
{
|
{
|
||||||
struct obj *otmp, *otmp2;
|
struct obj *otmp, *otmp2;
|
||||||
int where, maxobj = 1;
|
int where, maxobj = 1;
|
||||||
|
boolean at_crime_scene = In_mines(&u.uz);
|
||||||
|
|
||||||
if ((deliverflags & DF_RANDOM) && cnt > 1)
|
if ((deliverflags & DF_RANDOM) && cnt > 1)
|
||||||
maxobj = rnd(cnt);
|
maxobj = rnd(cnt);
|
||||||
@@ -1702,8 +1703,12 @@ unsigned long deliverflags;
|
|||||||
|
|
||||||
/* special treatment for orcs and their kind */
|
/* special treatment for orcs and their kind */
|
||||||
if ((otmp->corpsenm & M2_ORC) != 0 && has_oname(otmp)) {
|
if ((otmp->corpsenm & M2_ORC) != 0 && has_oname(otmp)) {
|
||||||
if (!has_mname(mtmp))
|
if (!has_mname(mtmp)) {
|
||||||
mtmp = christen_orc(mtmp, ONAME(otmp));
|
if (at_crime_scene || (!at_crime_scene && !rn2(2)))
|
||||||
|
mtmp = christen_orc(mtmp,
|
||||||
|
at_crime_scene ? ONAME(otmp) : (char *) 0,
|
||||||
|
" the Fence"); /* bought the stolen goods */
|
||||||
|
}
|
||||||
free_oname(otmp);
|
free_oname(otmp);
|
||||||
}
|
}
|
||||||
otmp->corpsenm = 0;
|
otmp->corpsenm = 0;
|
||||||
|
|||||||
+6
-2
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 explode.c $NHDT-Date: 1522454717 2018/03/31 00:05:17 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.56 $ */
|
/* NetHack 3.6 explode.c $NHDT-Date: 1543101719 2018/11/24 23:21:59 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.59 $ */
|
||||||
/* Copyright (C) 1990 by Ken Arromdee */
|
/* Copyright (C) 1990 by Ken Arromdee */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -616,6 +616,10 @@ struct obj *obj; /* only scatter this obj */
|
|||||||
struct scatter_chain *schain = (struct scatter_chain *) 0;
|
struct scatter_chain *schain = (struct scatter_chain *) 0;
|
||||||
long total = 0L;
|
long total = 0L;
|
||||||
|
|
||||||
|
if (individual_object && (obj->ox != sx || obj->oy != sy))
|
||||||
|
impossible("scattered object <%d,%d> not at scatter site <%d,%d>",
|
||||||
|
obj->ox, obj->oy, sx, sy);
|
||||||
|
|
||||||
while ((otmp = (individual_object ? obj : level.objects[sx][sy])) != 0) {
|
while ((otmp = (individual_object ? obj : level.objects[sx][sy])) != 0) {
|
||||||
if (otmp->quan > 1L) {
|
if (otmp->quan > 1L) {
|
||||||
qtmp = otmp->quan - 1L;
|
qtmp = otmp->quan - 1L;
|
||||||
@@ -759,7 +763,7 @@ struct obj *obj; /* only scatter this obj */
|
|||||||
free((genericptr_t) stmp);
|
free((genericptr_t) stmp);
|
||||||
newsym(x, y);
|
newsym(x, y);
|
||||||
}
|
}
|
||||||
|
newsym(sx, sy);
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -785,7 +785,7 @@ stolen_booty(VOID_ARGS)
|
|||||||
* member of the main orc horde.
|
* member of the main orc horde.
|
||||||
*/
|
*/
|
||||||
if (mtmp->data != &mons[PM_ORC_CAPTAIN])
|
if (mtmp->data != &mons[PM_ORC_CAPTAIN])
|
||||||
mtmp = christen_orc(mtmp, upstart(gang));
|
mtmp = christen_orc(mtmp, upstart(gang), "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Lastly, ensure there's several more orcs from the gang along the way.
|
/* Lastly, ensure there's several more orcs from the gang along the way.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 mon.c $NHDT-Date: 1543052701 2018/11/24 09:45:01 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.270 $ */
|
/* NetHack 3.6 mon.c $NHDT-Date: 1543100460 2018/11/24 23:01:00 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.271 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -2827,40 +2827,34 @@ boolean via_attack;
|
|||||||
void
|
void
|
||||||
wake_nearby()
|
wake_nearby()
|
||||||
{
|
{
|
||||||
register struct monst *mtmp;
|
wake_nearto(u.ux, u.uy, u.ulevel * 20);
|
||||||
|
|
||||||
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
|
|
||||||
if (DEADMONSTER(mtmp))
|
|
||||||
continue;
|
|
||||||
if (distu(mtmp->mx, mtmp->my) < u.ulevel * 20) {
|
|
||||||
mtmp->msleeping = 0;
|
|
||||||
if (!unique_corpstat(mtmp->data))
|
|
||||||
mtmp->mstrategy &= ~STRAT_WAITMASK;
|
|
||||||
if (mtmp->mtame) {
|
|
||||||
if (!mtmp->isminion)
|
|
||||||
EDOG(mtmp)->whistletime = moves;
|
|
||||||
/* Clear mtrack. This is to fix up a pet who is
|
|
||||||
stuck "fleeing" its master. */
|
|
||||||
memset(mtmp->mtrack, 0, sizeof(mtmp->mtrack));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wake up monsters near some particular location. */
|
/* Wake up monsters near some particular location. */
|
||||||
void
|
void
|
||||||
wake_nearto(x, y, distance)
|
wake_nearto(x, y, distance)
|
||||||
register int x, y, distance;
|
int x, y, distance;
|
||||||
{
|
{
|
||||||
register struct monst *mtmp;
|
struct monst *mtmp;
|
||||||
|
|
||||||
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
|
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
|
||||||
if (DEADMONSTER(mtmp))
|
if (DEADMONSTER(mtmp))
|
||||||
continue;
|
continue;
|
||||||
if (distance == 0 || dist2(mtmp->mx, mtmp->my, x, y) < distance) {
|
if (distance == 0 || dist2(mtmp->mx, mtmp->my, x, y) < distance) {
|
||||||
mtmp->msleeping = 0;
|
/* sleep for N turns uses mtmp->mfrozen, but so does paralysis
|
||||||
if (!unique_corpstat(mtmp->data))
|
so we leave mfrozen monsters alone */
|
||||||
mtmp->mstrategy &= ~STRAT_WAITMASK;
|
mtmp->msleeping = 0; /* wake indeterminate sleep */
|
||||||
|
if (!(mtmp->data->geno & G_UNIQ))
|
||||||
|
mtmp->mstrategy &= ~STRAT_WAITMASK; /* wake 'meditation' */
|
||||||
|
if (context.mon_moving)
|
||||||
|
continue;
|
||||||
|
if (mtmp->mtame) {
|
||||||
|
if (!mtmp->isminion)
|
||||||
|
EDOG(mtmp)->whistletime = moves;
|
||||||
|
/* Clear mtrack. This is to fix up a pet who is
|
||||||
|
stuck "fleeing" its master. */
|
||||||
|
memset(mtmp->mtrack, 0, sizeof mtmp->mtrack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+41
-17
@@ -1340,26 +1340,51 @@ boolean do_mons; /* True => monsters, False => objects */
|
|||||||
destroy_nhwindow(win);
|
destroy_nhwindow(win);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char *suptext1[] = {
|
||||||
|
"%s is a member of a marauding horde of orcs",
|
||||||
|
"rumored to have brutally attacked and plundered",
|
||||||
|
"the ordinarily sheltered town that is located ",
|
||||||
|
"deep within The Gnomish Mines.",
|
||||||
|
"",
|
||||||
|
"The members of that vicious horde proudly and ",
|
||||||
|
"defiantly acclaim their allegiance to their",
|
||||||
|
"leader %s in their names.",
|
||||||
|
(char *) 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const char *suptext2[] = {
|
||||||
|
"%s is a nefarious orc who is known to acquire",
|
||||||
|
"property from thieves and sell it off for profit",
|
||||||
|
"or gain. The perpetrator was last seen hanging",
|
||||||
|
"around the stairs leading to the Gnomish Mines.",
|
||||||
|
(char *) 0,
|
||||||
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
do_supplemental_info(name, pm, without_asking)
|
do_supplemental_info(name, pm, without_asking)
|
||||||
char *name;
|
char *name;
|
||||||
struct permonst *pm;
|
struct permonst *pm;
|
||||||
boolean without_asking;
|
boolean without_asking;
|
||||||
{
|
{
|
||||||
|
const char **textp;
|
||||||
winid datawin = WIN_ERR;
|
winid datawin = WIN_ERR;
|
||||||
char *entrytext = name, *bp;
|
char *entrytext = name, *bp = (char *) 0, *bp2 = (char *) 0;
|
||||||
char question[QBUFSZ];
|
char question[QBUFSZ];
|
||||||
boolean yes_to_moreinfo = FALSE;
|
boolean yes_to_moreinfo = FALSE;
|
||||||
|
boolean is_marauder = (name && pm && is_orc(pm));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Provide some info on some specific things
|
* Provide some info on some specific things
|
||||||
* meant to support in-game mythology, and not
|
* meant to support in-game mythology, and not
|
||||||
* available from data.base or other sources.
|
* available from data.base or other sources.
|
||||||
*/
|
*/
|
||||||
if (name && pm && is_orc(pm) && (strlen(name) < (BUFSZ - 1))
|
if (is_marauder && (strlen(name) < (BUFSZ - 1))) {
|
||||||
&& (bp = strstri(name, " of ")) != 0) {
|
|
||||||
char fullname[BUFSZ];
|
char fullname[BUFSZ];
|
||||||
|
|
||||||
|
bp = strstri(name, " of ");
|
||||||
|
bp2 = strstri(name, " the Fence");
|
||||||
|
|
||||||
|
if (bp || bp2) {
|
||||||
Strcpy(fullname, name);
|
Strcpy(fullname, name);
|
||||||
if (!without_asking) {
|
if (!without_asking) {
|
||||||
Strcpy(question, "More info about \"");
|
Strcpy(question, "More info about \"");
|
||||||
@@ -1372,34 +1397,33 @@ boolean without_asking;
|
|||||||
}
|
}
|
||||||
if (yes_to_moreinfo) {
|
if (yes_to_moreinfo) {
|
||||||
int i, subs = 0;
|
int i, subs = 0;
|
||||||
char *gang = bp + 4;
|
char *gang = (char *) 0;
|
||||||
static const char *text[] = {
|
|
||||||
"%s is a member of a marauding horde of orcs",
|
|
||||||
"rumored to have brutally attacked and plundered the ordinarily",
|
|
||||||
"sheltered town that is located deep within The Gnomish Mines.",
|
|
||||||
"",
|
|
||||||
"The members of that vicious horde proudly and defiantly acclaim",
|
|
||||||
"their allegiance to their leader %s in their names.",
|
|
||||||
};
|
|
||||||
|
|
||||||
|
if (bp) {
|
||||||
|
textp = suptext1;
|
||||||
|
gang = bp + 4;
|
||||||
*bp = '\0';
|
*bp = '\0';
|
||||||
|
} else {
|
||||||
|
textp = suptext2;
|
||||||
|
gang = "";
|
||||||
|
}
|
||||||
datawin = create_nhwindow(NHW_MENU);
|
datawin = create_nhwindow(NHW_MENU);
|
||||||
for (i = 0; i < SIZE(text); i++) {
|
for (i = 0; textp[i]; i++) {
|
||||||
char buf[BUFSZ];
|
char buf[BUFSZ];
|
||||||
const char *txt;
|
const char *txt;
|
||||||
|
|
||||||
if (strstri(text[i], "%s") != 0) {
|
if (strstri(textp[i], "%s") != 0) {
|
||||||
Sprintf(buf, text[i],
|
Sprintf(buf, textp[i], subs++ ? gang : fullname);
|
||||||
subs++ ? gang : fullname);
|
|
||||||
txt = buf;
|
txt = buf;
|
||||||
} else
|
} else
|
||||||
txt = text[i];
|
txt = textp[i];
|
||||||
putstr(datawin, 0, txt);
|
putstr(datawin, 0, txt);
|
||||||
}
|
}
|
||||||
display_nhwindow(datawin, FALSE);
|
display_nhwindow(datawin, FALSE);
|
||||||
destroy_nhwindow(datawin), datawin = WIN_ERR;
|
destroy_nhwindow(datawin), datawin = WIN_ERR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the '/' command */
|
/* the '/' command */
|
||||||
|
|||||||
+5
-2
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 trap.c $NHDT-Date: 1542856572 2018/11/22 03:16:12 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.304 $ */
|
/* NetHack 3.6 trap.c $NHDT-Date: 1543100476 2018/11/24 23:01:16 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.311 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -3164,7 +3164,7 @@ domagictrap()
|
|||||||
|
|
||||||
if (fate < 10) {
|
if (fate < 10) {
|
||||||
/* Most of the time, it creates some monsters. */
|
/* Most of the time, it creates some monsters. */
|
||||||
register int cnt = rnd(4);
|
int cnt = rnd(4);
|
||||||
|
|
||||||
/* blindness effects */
|
/* blindness effects */
|
||||||
if (!resists_blnd(&youmonst)) {
|
if (!resists_blnd(&youmonst)) {
|
||||||
@@ -3189,6 +3189,9 @@ domagictrap()
|
|||||||
}
|
}
|
||||||
while (cnt--)
|
while (cnt--)
|
||||||
(void) makemon((struct permonst *) 0, u.ux, u.uy, NO_MM_FLAGS);
|
(void) makemon((struct permonst *) 0, u.ux, u.uy, NO_MM_FLAGS);
|
||||||
|
/* roar: wake monsters in vicinity, after placing trap-created ones */
|
||||||
|
wake_nearto(u.ux, u.uy, 7 * 7);
|
||||||
|
/* [flash: should probably also hit nearby gremlins with light] */
|
||||||
} else
|
} else
|
||||||
switch (fate) {
|
switch (fate) {
|
||||||
case 10:
|
case 10:
|
||||||
|
|||||||
@@ -686,7 +686,8 @@ $(O)install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\dungeon \
|
|||||||
if exist $(DOC)\nethack.txt copy $(DOC)\nethack.txt $(GAMEDIR)\NetHack.txt
|
if exist $(DOC)\nethack.txt copy $(DOC)\nethack.txt $(GAMEDIR)\NetHack.txt
|
||||||
@if exist $(GAMEDIR)\NetHack.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHack.PDB to conserve space
|
@if exist $(GAMEDIR)\NetHack.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHack.PDB to conserve space
|
||||||
@if exist $(GAMEDIR)\NetHackW.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHackW.PDB to conserve space
|
@if exist $(GAMEDIR)\NetHackW.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHackW.PDB to conserve space
|
||||||
-if not exist $(GAMEDIR)\defaults.nh copy $(MSWSYS)\defaults.nh $(GAMEDIR)\defaults.nh
|
$(U)makedefs -c
|
||||||
|
-if not exist $(GAMEDIR)\defaults.nh copy fixed_defaults.nh $(GAMEDIR)\defaults.nh
|
||||||
-if not exist $(GAMEDIR)\record. goto>$(GAMEDIR)\record.
|
-if not exist $(GAMEDIR)\record. goto>$(GAMEDIR)\record.
|
||||||
echo install done > $@
|
echo install done > $@
|
||||||
|
|
||||||
@@ -1359,6 +1360,7 @@ clean:
|
|||||||
if exist $(U)dgncomp.exe del $(U)dgncomp.exe
|
if exist $(U)dgncomp.exe del $(U)dgncomp.exe
|
||||||
if exist $(SRC)\*.lnk del $(SRC)\*.lnk
|
if exist $(SRC)\*.lnk del $(SRC)\*.lnk
|
||||||
if exist $(SRC)\*.map del $(SRC)\*.map
|
if exist $(SRC)\*.map del $(SRC)\*.map
|
||||||
|
if exist $(SRC)\fixed_defaults.nh del $(SRC)\fixed_defaults.nh
|
||||||
if exist $(O)install.tag del $(O)install.tag
|
if exist $(O)install.tag del $(O)install.tag
|
||||||
if exist $(O)console.res del $(O)console.res
|
if exist $(O)console.res del $(O)console.res
|
||||||
if exist $(O)dgncomp.MAP del $(O)dgncomp.MAP
|
if exist $(O)dgncomp.MAP del $(O)dgncomp.MAP
|
||||||
|
|||||||
+57
-1
@@ -111,6 +111,15 @@ static const char SCCS_Id[] UNUSED = "@(#)makedefs.c\t3.6\t2018/03/02";
|
|||||||
#endif /* else !MAC */
|
#endif /* else !MAC */
|
||||||
#endif /* else !AMIGA */
|
#endif /* else !AMIGA */
|
||||||
|
|
||||||
|
#if !defined(STATUS_HILITES) && defined(WIN32)
|
||||||
|
#define FIX_SAMPLECONFIG
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#define SAMPLE_CONFIGFILE "../sys/winnt/defaults.nh"
|
||||||
|
#define FIXED_CONFIGFILE "./fixed_defaults.nh"
|
||||||
|
#endif
|
||||||
|
|
||||||
static const char
|
static const char
|
||||||
*Dont_Edit_Code =
|
*Dont_Edit_Code =
|
||||||
"/* This source file is generated by 'makedefs'. Do not edit. */\n",
|
"/* This source file is generated by 'makedefs'. Do not edit. */\n",
|
||||||
@@ -162,6 +171,9 @@ void NDECL(do_questtxt);
|
|||||||
void NDECL(do_rumors);
|
void NDECL(do_rumors);
|
||||||
void NDECL(do_oracles);
|
void NDECL(do_oracles);
|
||||||
void NDECL(do_vision);
|
void NDECL(do_vision);
|
||||||
|
#ifdef WIN32
|
||||||
|
void NDECL(do_fix_sampleconfig);
|
||||||
|
#endif
|
||||||
|
|
||||||
extern void NDECL(monst_init); /* monst.c */
|
extern void NDECL(monst_init); /* monst.c */
|
||||||
extern void NDECL(objects_init); /* objects.c */
|
extern void NDECL(objects_init); /* objects.c */
|
||||||
@@ -364,7 +376,12 @@ char *options;
|
|||||||
case 'Z':
|
case 'Z':
|
||||||
do_vision();
|
do_vision();
|
||||||
break;
|
break;
|
||||||
|
#ifdef WIN32
|
||||||
|
case 'c':
|
||||||
|
case 'C':
|
||||||
|
do_fix_sampleconfig();
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
Fprintf(stderr, "Unknown option '%c'.\n", *options);
|
Fprintf(stderr, "Unknown option '%c'.\n", *options);
|
||||||
(void) fflush(stderr);
|
(void) fflush(stderr);
|
||||||
@@ -1457,6 +1474,45 @@ char *githash, *gitbranch;
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
void
|
||||||
|
do_fix_sampleconfig()
|
||||||
|
{
|
||||||
|
FILE *scfp, *ofcfp;
|
||||||
|
char fixedline[600];
|
||||||
|
char *line;
|
||||||
|
|
||||||
|
if (!(scfp = fopen(SAMPLE_CONFIGFILE, RDTMODE))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!(ofcfp = fopen(FIXED_CONFIGFILE, WRTMODE))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* read the sample config file */
|
||||||
|
while ((line = fgetline(scfp)) != 0) {
|
||||||
|
/* comment out the STATUS_HILITES related lines */
|
||||||
|
if (strlen(line) < (600 - 1)) {
|
||||||
|
if (strstr(line, "statushilites") || strstr(line, "hilite_status:")) {
|
||||||
|
#ifdef FIX_SAMPLECONFIG
|
||||||
|
fixedline[0] = '#';
|
||||||
|
Strcpy(&fixedline[1], line);
|
||||||
|
#else
|
||||||
|
Strcpy(fixedline, line);
|
||||||
|
#endif
|
||||||
|
fputs(fixedline, ofcfp);
|
||||||
|
} else {
|
||||||
|
fputs(line, ofcfp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free(line);
|
||||||
|
}
|
||||||
|
Fclose(scfp);
|
||||||
|
Fclose(ofcfp);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif /* WIN32 */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
case_insensitive_comp(s1, s2)
|
case_insensitive_comp(s1, s2)
|
||||||
const char *s1;
|
const char *s1;
|
||||||
|
|||||||
+20
-18
@@ -3612,26 +3612,10 @@ const char *fmt;
|
|||||||
boolean enable;
|
boolean enable;
|
||||||
{
|
{
|
||||||
genl_status_enablefield(fieldidx, nm, fmt, enable);
|
genl_status_enablefield(fieldidx, nm, fmt, enable);
|
||||||
|
#ifdef STATUS_HILITES
|
||||||
/* force re-evaluation of last field on the row */
|
/* force re-evaluation of last field on the row */
|
||||||
setlast = FALSE;
|
setlast = FALSE;
|
||||||
}
|
#endif
|
||||||
|
|
||||||
void
|
|
||||||
do_setlast()
|
|
||||||
{
|
|
||||||
int i, row, fld;
|
|
||||||
|
|
||||||
setlast = TRUE;
|
|
||||||
for (row = 0; row < 2; ++row)
|
|
||||||
for (i = MAX_PER_ROW - 1; i > 0; --i) {
|
|
||||||
fld = fieldorder[row][i];
|
|
||||||
|
|
||||||
if (fld == BL_FLUSH || !status_activefields[fld])
|
|
||||||
continue;
|
|
||||||
|
|
||||||
last_on_row[row] = fld;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef STATUS_HILITES
|
#ifdef STATUS_HILITES
|
||||||
@@ -3807,6 +3791,24 @@ unsigned long *colormasks;
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
do_setlast()
|
||||||
|
{
|
||||||
|
int i, row, fld;
|
||||||
|
|
||||||
|
setlast = TRUE;
|
||||||
|
for (row = 0; row < 2; ++row)
|
||||||
|
for (i = MAX_PER_ROW - 1; i > 0; --i) {
|
||||||
|
fld = fieldorder[row][i];
|
||||||
|
|
||||||
|
if (fld == BL_FLUSH || !status_activefields[fld])
|
||||||
|
continue;
|
||||||
|
|
||||||
|
last_on_row[row] = fld;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
STATIC_OVL int
|
STATIC_OVL int
|
||||||
make_things_fit(force_update)
|
make_things_fit(force_update)
|
||||||
boolean force_update;
|
boolean force_update;
|
||||||
|
|||||||
Reference in New Issue
Block a user