replace leading tabs in several files

This commit is contained in:
nhmall
2022-05-30 12:09:35 -04:00
parent 81cff2390f
commit a8f0e91ddf
18 changed files with 186 additions and 186 deletions
+1 -1
View File
@@ -1245,7 +1245,7 @@ wiz_load_lua(void)
{ {
if (wizard) { if (wizard) {
char buf[BUFSZ]; char buf[BUFSZ];
nhl_sandbox_info sbi = {NHL_SB_SAFE, 0, 0, 0}; nhl_sandbox_info sbi = {NHL_SB_SAFE, 0, 0, 0};
buf[0] = '\0'; buf[0] = '\0';
getlin("Load which lua file?", buf); getlin("Load which lua file?", buf);
+2 -2
View File
@@ -1871,7 +1871,7 @@ save_killers(NHFILE *nhfp)
if (perform_bwrite(nhfp)) { if (perform_bwrite(nhfp)) {
for (kptr = &g.killer; kptr != (struct kinfo *) 0; kptr = kptr->next) { for (kptr = &g.killer; kptr != (struct kinfo *) 0; kptr = kptr->next) {
if (nhfp->structlevel) if (nhfp->structlevel)
bwrite(nhfp->fd, (genericptr_t)kptr, sizeof(struct kinfo)); bwrite(nhfp->fd, (genericptr_t)kptr, sizeof(struct kinfo));
} }
} }
if (release_data(nhfp)) { if (release_data(nhfp)) {
@@ -1890,7 +1890,7 @@ restore_killers(NHFILE *nhfp)
for (kptr = &g.killer; kptr != (struct kinfo *) 0; kptr = kptr->next) { for (kptr = &g.killer; kptr != (struct kinfo *) 0; kptr = kptr->next) {
if (nhfp->structlevel) if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t)kptr, sizeof(struct kinfo)); mread(nhfp->fd, (genericptr_t)kptr, sizeof(struct kinfo));
if (kptr->next) { if (kptr->next) {
kptr->next = (struct kinfo *) alloc(sizeof (struct kinfo)); kptr->next = (struct kinfo *) alloc(sizeof (struct kinfo));
} }
+3 -3
View File
@@ -560,9 +560,9 @@ explode(
g.context.botl = 1; g.context.botl = 1;
} }
/* You resisted the damage, lets not keep that to ourselves */ /* You resisted the damage, lets not keep that to ourselves */
if (uhurt == 1) if (uhurt == 1)
monstseesu_ad(adtyp); monstseesu_ad(adtyp);
if (u.uhp <= 0 || (Upolyd && u.mh <= 0)) { if (u.uhp <= 0 || (Upolyd && u.mh <= 0)) {
if (Upolyd) { if (Upolyd) {
+2 -2
View File
@@ -34,13 +34,13 @@
/* Extract ISAAC64_SZ_LOG bits (starting at bit 3). */ /* Extract ISAAC64_SZ_LOG bits (starting at bit 3). */
static inline uint32_t lower_bits(uint64_t x) static inline uint32_t lower_bits(uint64_t x)
{ {
return (x & ((ISAAC64_SZ-1) << 3)) >>3; return (x & ((ISAAC64_SZ-1) << 3)) >>3;
} }
/* Extract next ISAAC64_SZ_LOG bits (starting at bit ISAAC64_SZ_LOG+2). */ /* Extract next ISAAC64_SZ_LOG bits (starting at bit ISAAC64_SZ_LOG+2). */
static inline uint32_t upper_bits(uint64_t y) static inline uint32_t upper_bits(uint64_t y)
{ {
return (y >> (ISAAC64_SZ_LOG+3)) & (ISAAC64_SZ-1); return (y >> (ISAAC64_SZ_LOG+3)) & (ISAAC64_SZ-1);
} }
static void isaac64_update(isaac64_ctx *_ctx){ static void isaac64_update(isaac64_ctx *_ctx){
+1 -1
View File
@@ -69,7 +69,7 @@ new_light_core(xchar x, xchar y, int range, int type, anything *id)
/* camera flash uses radius 0 and passes Null object */ /* camera flash uses radius 0 and passes Null object */
|| (range == 0 && (type != LS_OBJECT || id->a_obj != 0))) { || (range == 0 && (type != LS_OBJECT || id->a_obj != 0))) {
impossible("new_light_source: illegal range %d", range); impossible("new_light_source: illegal range %d", range);
return (light_source *) 0; return (light_source *) 0;
} }
ls = (light_source *) alloc(sizeof *ls); ls = (light_source *) alloc(sizeof *ls);
+1 -1
View File
@@ -664,7 +664,7 @@ ck_server_admin_msg(void)
if (!stat(SERVER_ADMIN_MSG, &nst)) { if (!stat(SERVER_ADMIN_MSG, &nst)) {
if (nst.st_mtime > ost.st_mtime) if (nst.st_mtime > ost.st_mtime)
read_simplemail(nonconst(SERVER_ADMIN_MSG, adminbuf, read_simplemail(nonconst(SERVER_ADMIN_MSG, adminbuf,
sizeof adminbuf), TRUE); sizeof adminbuf), TRUE);
ost.st_mtime = nst.st_mtime; ost.st_mtime = nst.st_mtime;
} }
#endif /* SERVER_ADMIN_MSG */ #endif /* SERVER_ADMIN_MSG */
+1 -1
View File
@@ -1916,7 +1916,7 @@ doseduce(struct monst *mon)
yourgloves ? " and eleven more pairs of gloves" yourgloves ? " and eleven more pairs of gloves"
: ""); : "");
} }
} else if (seewho) } else if (seewho)
pline("%s appears to sigh.", Monnam(mon)); pline("%s appears to sigh.", Monnam(mon));
/* else no regret message if can't see or hear seducer */ /* else no regret message if can't see or hear seducer */
+3 -3
View File
@@ -304,9 +304,9 @@ makerooms(void)
iflags.in_lua = g.in_mk_themerooms = TRUE; iflags.in_lua = g.in_mk_themerooms = TRUE;
g.themeroom_failed = FALSE; g.themeroom_failed = FALSE;
lua_getglobal(themes, "themerooms_generate"); lua_getglobal(themes, "themerooms_generate");
if ( nhl_pcall(themes, 0, 0)){ if ( nhl_pcall(themes, 0, 0)){
impossible("Lua error: %s", lua_tostring(themes, -1)); impossible("Lua error: %s", lua_tostring(themes, -1));
} }
iflags.in_lua = g.in_mk_themerooms = FALSE; iflags.in_lua = g.in_mk_themerooms = FALSE;
if (g.themeroom_failed if (g.themeroom_failed
&& ((themeroom_tries++ > 10) && ((themeroom_tries++ > 10)
+5 -5
View File
@@ -817,11 +817,11 @@ l_selection_iterate(lua_State *L)
lua_pushvalue(L, 2); lua_pushvalue(L, 2);
lua_pushinteger(L, x - g.xstart); lua_pushinteger(L, x - g.xstart);
lua_pushinteger(L, y - g.ystart); lua_pushinteger(L, y - g.ystart);
if (nhl_pcall(L, 2, 0)) { if (nhl_pcall(L, 2, 0)) {
impossible("Lua error: %s", lua_tostring(L, -1)); impossible("Lua error: %s", lua_tostring(L, -1));
/* abort the loops to prevent possible error cascade */ /* abort the loops to prevent possible error cascade */
goto out; goto out;
} }
} }
} else { } else {
nhl_error(L, "wrong parameters"); nhl_error(L, "wrong parameters");
+1 -1
View File
@@ -417,7 +417,7 @@ restnames(NHFILE* nhfp)
if (nhfp->structlevel) { if (nhfp->structlevel) {
mread(nhfp->fd, (genericptr_t)objects[i].oc_uname, len); mread(nhfp->fd, (genericptr_t)objects[i].oc_uname, len);
} }
} }
} }
#ifdef USE_TILES #ifdef USE_TILES
shuffle_tiles(); shuffle_tiles();
+6 -6
View File
@@ -1453,18 +1453,18 @@ validate(NHFILE* nhfp, const char *name)
if (!(reslt = uptodate(nhfp, name, utdflags))) return 1; if (!(reslt = uptodate(nhfp, name, utdflags))) return 1;
if ((nhfp->mode & WRITING) == 0) { if ((nhfp->mode & WRITING) == 0) {
if (nhfp->structlevel) if (nhfp->structlevel)
rlen = (readLenType) read(nhfp->fd, (genericptr_t) &sfi, sizeof sfi); rlen = (readLenType) read(nhfp->fd, (genericptr_t) &sfi, sizeof sfi);
} else { } else {
if (nhfp->structlevel) if (nhfp->structlevel)
rlen = (readLenType) read(nhfp->fd, (genericptr_t) &sfi, sizeof sfi); rlen = (readLenType) read(nhfp->fd, (genericptr_t) &sfi, sizeof sfi);
minit(); /* ZEROCOMP */ minit(); /* ZEROCOMP */
if (rlen == 0) { if (rlen == 0) {
if (verbose) { if (verbose) {
pline("File \"%s\" is empty during save file feature check?", name); pline("File \"%s\" is empty during save file feature check?", name);
wait_synch(); wait_synch();
} }
return -1; return -1;
} }
} }
return 0; return 0;
+1 -1
View File
@@ -1441,7 +1441,7 @@ add_sound_mapping(const char* mapping)
if (strlen(sounddir) + 1 + strlen(filename) >= sizeof filespec) { if (strlen(sounddir) + 1 + strlen(filename) >= sizeof filespec) {
raw_print("sound file name too long"); raw_print("sound file name too long");
return 0; return 0;
} }
Snprintf(filespec, sizeof filespec, "%s/%s", sounddir, filename); Snprintf(filespec, sizeof filespec, "%s/%s", sounddir, filename);
if (idx >= 0 || can_read_file(filespec)) { if (idx >= 0 || can_read_file(filespec)) {
+150 -150
View File
@@ -543,46 +543,46 @@ flip_level(int flp, boolean extras)
for (ttmp = g.ftrap; ttmp; ttmp = ttmp->ntrap) { for (ttmp = g.ftrap; ttmp; ttmp = ttmp->ntrap) {
if (!inFlipArea(ttmp->tx, ttmp->ty)) if (!inFlipArea(ttmp->tx, ttmp->ty))
continue; continue;
if (flp & 1) { if (flp & 1) {
ttmp->ty = FlipY(ttmp->ty); ttmp->ty = FlipY(ttmp->ty);
if (ttmp->ttyp == ROLLING_BOULDER_TRAP) { if (ttmp->ttyp == ROLLING_BOULDER_TRAP) {
ttmp->launch.y = FlipY(ttmp->launch.y); ttmp->launch.y = FlipY(ttmp->launch.y);
ttmp->launch2.y = FlipY(ttmp->launch2.y); ttmp->launch2.y = FlipY(ttmp->launch2.y);
} else if (is_pit(ttmp->ttyp) && ttmp->conjoined) { } else if (is_pit(ttmp->ttyp) && ttmp->conjoined) {
ttmp->conjoined = flip_encoded_direction_bits(flp, ttmp->conjoined = flip_encoded_direction_bits(flp,
ttmp->conjoined); ttmp->conjoined);
} }
} }
if (flp & 2) { if (flp & 2) {
ttmp->tx = FlipX(ttmp->tx); ttmp->tx = FlipX(ttmp->tx);
if (ttmp->ttyp == ROLLING_BOULDER_TRAP) { if (ttmp->ttyp == ROLLING_BOULDER_TRAP) {
ttmp->launch.x = FlipX(ttmp->launch.x); ttmp->launch.x = FlipX(ttmp->launch.x);
ttmp->launch2.x = FlipX(ttmp->launch2.x); ttmp->launch2.x = FlipX(ttmp->launch2.x);
} else if (is_pit(ttmp->ttyp) && ttmp->conjoined) { } else if (is_pit(ttmp->ttyp) && ttmp->conjoined) {
ttmp->conjoined = flip_encoded_direction_bits(flp, ttmp->conjoined = flip_encoded_direction_bits(flp,
ttmp->conjoined); ttmp->conjoined);
} }
} }
} }
/* objects */ /* objects */
for (otmp = fobj; otmp; otmp = otmp->nobj) { for (otmp = fobj; otmp; otmp = otmp->nobj) {
if (!inFlipArea(otmp->ox, otmp->oy)) if (!inFlipArea(otmp->ox, otmp->oy))
continue; continue;
if (flp & 1) if (flp & 1)
otmp->oy = FlipY(otmp->oy); otmp->oy = FlipY(otmp->oy);
if (flp & 2) if (flp & 2)
otmp->ox = FlipX(otmp->ox); otmp->ox = FlipX(otmp->ox);
} }
/* buried objects */ /* buried objects */
for (otmp = g.level.buriedobjlist; otmp; otmp = otmp->nobj) { for (otmp = g.level.buriedobjlist; otmp; otmp = otmp->nobj) {
if (!inFlipArea(otmp->ox, otmp->oy)) if (!inFlipArea(otmp->ox, otmp->oy))
continue; continue;
if (flp & 1) if (flp & 1)
otmp->oy = FlipY(otmp->oy); otmp->oy = FlipY(otmp->oy);
if (flp & 2) if (flp & 2)
otmp->ox = FlipX(otmp->ox); otmp->ox = FlipX(otmp->ox);
} }
/* monsters */ /* monsters */
@@ -592,10 +592,10 @@ flip_level(int flp, boolean extras)
/* skip the occasional earth elemental outside the flip area */ /* skip the occasional earth elemental outside the flip area */
if (!inFlipArea(mtmp->mx, mtmp->my)) if (!inFlipArea(mtmp->mx, mtmp->my))
continue; continue;
if (flp & 1) if (flp & 1)
mtmp->my = FlipY(mtmp->my); mtmp->my = FlipY(mtmp->my);
if (flp & 2) if (flp & 2)
mtmp->mx = FlipX(mtmp->mx); mtmp->mx = FlipX(mtmp->mx);
if (mtmp->ispriest) { if (mtmp->ispriest) {
Flip_coord(EPRI(mtmp)->shrpos); Flip_coord(EPRI(mtmp)->shrpos);
@@ -606,8 +606,8 @@ flip_level(int flp, boolean extras)
if (flp & 1) if (flp & 1)
flip_worm_segs_vertical(mtmp, miny, maxy); flip_worm_segs_vertical(mtmp, miny, maxy);
if (flp & 2) if (flp & 2)
flip_worm_segs_horizontal(mtmp, minx, maxx); flip_worm_segs_horizontal(mtmp, minx, maxx);
} }
#if 0 /* not useful unless tracking also gets flipped */ #if 0 /* not useful unless tracking also gets flipped */
if (extras) { if (extras) {
if (mtmp->tame && has_edog(mtmp)) if (mtmp->tame && has_edog(mtmp))
@@ -618,48 +618,48 @@ flip_level(int flp, boolean extras)
/* engravings */ /* engravings */
for (etmp = head_engr; etmp; etmp = etmp->nxt_engr) { for (etmp = head_engr; etmp; etmp = etmp->nxt_engr) {
if (flp & 1) if (flp & 1)
etmp->engr_y = FlipY(etmp->engr_y); etmp->engr_y = FlipY(etmp->engr_y);
if (flp & 2) if (flp & 2)
etmp->engr_x = FlipX(etmp->engr_x); etmp->engr_x = FlipX(etmp->engr_x);
} }
/* level (teleport) regions */ /* level (teleport) regions */
for (i = 0; i < g.num_lregions; i++) { for (i = 0; i < g.num_lregions; i++) {
if (flp & 1) { if (flp & 1) {
g.lregions[i].inarea.y1 = FlipY(g.lregions[i].inarea.y1); g.lregions[i].inarea.y1 = FlipY(g.lregions[i].inarea.y1);
g.lregions[i].inarea.y2 = FlipY(g.lregions[i].inarea.y2); g.lregions[i].inarea.y2 = FlipY(g.lregions[i].inarea.y2);
if (g.lregions[i].inarea.y1 > g.lregions[i].inarea.y2) { if (g.lregions[i].inarea.y1 > g.lregions[i].inarea.y2) {
itmp = g.lregions[i].inarea.y1; itmp = g.lregions[i].inarea.y1;
g.lregions[i].inarea.y1 = g.lregions[i].inarea.y2; g.lregions[i].inarea.y1 = g.lregions[i].inarea.y2;
g.lregions[i].inarea.y2 = itmp; g.lregions[i].inarea.y2 = itmp;
} }
g.lregions[i].delarea.y1 = FlipY(g.lregions[i].delarea.y1); g.lregions[i].delarea.y1 = FlipY(g.lregions[i].delarea.y1);
g.lregions[i].delarea.y2 = FlipY(g.lregions[i].delarea.y2); g.lregions[i].delarea.y2 = FlipY(g.lregions[i].delarea.y2);
if (g.lregions[i].delarea.y1 > g.lregions[i].delarea.y2) { if (g.lregions[i].delarea.y1 > g.lregions[i].delarea.y2) {
itmp = g.lregions[i].delarea.y1; itmp = g.lregions[i].delarea.y1;
g.lregions[i].delarea.y1 = g.lregions[i].delarea.y2; g.lregions[i].delarea.y1 = g.lregions[i].delarea.y2;
g.lregions[i].delarea.y2 = itmp; g.lregions[i].delarea.y2 = itmp;
} }
} }
if (flp & 2) { if (flp & 2) {
g.lregions[i].inarea.x1 = FlipX(g.lregions[i].inarea.x1); g.lregions[i].inarea.x1 = FlipX(g.lregions[i].inarea.x1);
g.lregions[i].inarea.x2 = FlipX(g.lregions[i].inarea.x2); g.lregions[i].inarea.x2 = FlipX(g.lregions[i].inarea.x2);
if (g.lregions[i].inarea.x1 > g.lregions[i].inarea.x2) { if (g.lregions[i].inarea.x1 > g.lregions[i].inarea.x2) {
itmp = g.lregions[i].inarea.x1; itmp = g.lregions[i].inarea.x1;
g.lregions[i].inarea.x1 = g.lregions[i].inarea.x2; g.lregions[i].inarea.x1 = g.lregions[i].inarea.x2;
g.lregions[i].inarea.x2 = itmp; g.lregions[i].inarea.x2 = itmp;
} }
g.lregions[i].delarea.x1 = FlipX(g.lregions[i].delarea.x1); g.lregions[i].delarea.x1 = FlipX(g.lregions[i].delarea.x1);
g.lregions[i].delarea.x2 = FlipX(g.lregions[i].delarea.x2); g.lregions[i].delarea.x2 = FlipX(g.lregions[i].delarea.x2);
if (g.lregions[i].delarea.x1 > g.lregions[i].delarea.x2) { if (g.lregions[i].delarea.x1 > g.lregions[i].delarea.x2) {
itmp = g.lregions[i].delarea.x1; itmp = g.lregions[i].delarea.x1;
g.lregions[i].delarea.x1 = g.lregions[i].delarea.x2; g.lregions[i].delarea.x1 = g.lregions[i].delarea.x2;
g.lregions[i].delarea.x2 = itmp; g.lregions[i].delarea.x2 = itmp;
} }
} }
} }
/* regions (poison clouds, etc) */ /* regions (poison clouds, etc) */
@@ -693,100 +693,100 @@ flip_level(int flp, boolean extras)
/* rooms */ /* rooms */
for (sroom = &g.rooms[0]; ; sroom++) { for (sroom = &g.rooms[0]; ; sroom++) {
if (sroom->hx < 0) if (sroom->hx < 0)
break; break;
if (flp & 1) { if (flp & 1) {
sroom->ly = FlipY(sroom->ly); sroom->ly = FlipY(sroom->ly);
sroom->hy = FlipY(sroom->hy); sroom->hy = FlipY(sroom->hy);
if (sroom->ly > sroom->hy) { if (sroom->ly > sroom->hy) {
itmp = sroom->ly; itmp = sroom->ly;
sroom->ly = sroom->hy; sroom->ly = sroom->hy;
sroom->hy = itmp; sroom->hy = itmp;
} }
} }
if (flp & 2) { if (flp & 2) {
sroom->lx = FlipX(sroom->lx); sroom->lx = FlipX(sroom->lx);
sroom->hx = FlipX(sroom->hx); sroom->hx = FlipX(sroom->hx);
if (sroom->lx > sroom->hx) { if (sroom->lx > sroom->hx) {
itmp = sroom->lx; itmp = sroom->lx;
sroom->lx = sroom->hx; sroom->lx = sroom->hx;
sroom->hx = itmp; sroom->hx = itmp;
} }
} }
if (sroom->nsubrooms) if (sroom->nsubrooms)
for (i = 0; i < sroom->nsubrooms; i++) { for (i = 0; i < sroom->nsubrooms; i++) {
struct mkroom *rroom = sroom->sbrooms[i]; struct mkroom *rroom = sroom->sbrooms[i];
if (flp & 1) { if (flp & 1) {
rroom->ly = FlipY(rroom->ly); rroom->ly = FlipY(rroom->ly);
rroom->hy = FlipY(rroom->hy); rroom->hy = FlipY(rroom->hy);
if (rroom->ly > rroom->hy) { if (rroom->ly > rroom->hy) {
itmp = rroom->ly; itmp = rroom->ly;
rroom->ly = rroom->hy; rroom->ly = rroom->hy;
rroom->hy = itmp; rroom->hy = itmp;
} }
} }
if (flp & 2) { if (flp & 2) {
rroom->lx = FlipX(rroom->lx); rroom->lx = FlipX(rroom->lx);
rroom->hx = FlipX(rroom->hx); rroom->hx = FlipX(rroom->hx);
if (rroom->lx > rroom->hx) { if (rroom->lx > rroom->hx) {
itmp = rroom->lx; itmp = rroom->lx;
rroom->lx = rroom->hx; rroom->lx = rroom->hx;
rroom->hx = itmp; rroom->hx = itmp;
} }
} }
} }
} }
/* doors */ /* doors */
for (i = 0; i < g.doorindex; i++) { for (i = 0; i < g.doorindex; i++) {
Flip_coord(g.doors[i]); Flip_coord(g.doors[i]);
} }
/* the map */ /* the map */
if (flp & 1) { if (flp & 1) {
for (x = minx; x <= maxx; x++) for (x = minx; x <= maxx; x++)
for (y = miny; y < (miny + ((maxy - miny + 1) / 2)); y++) { for (y = miny; y < (miny + ((maxy - miny + 1) / 2)); y++) {
int ny = FlipY(y); int ny = FlipY(y);
flip_drawbridge_vertical(&levl[x][y]); flip_drawbridge_vertical(&levl[x][y]);
flip_drawbridge_vertical(&levl[x][ny]); flip_drawbridge_vertical(&levl[x][ny]);
trm = levl[x][y]; trm = levl[x][y];
levl[x][y] = levl[x][ny]; levl[x][y] = levl[x][ny];
levl[x][ny] = trm; levl[x][ny] = trm;
otmp = g.level.objects[x][y]; otmp = g.level.objects[x][y];
g.level.objects[x][y] = g.level.objects[x][ny]; g.level.objects[x][y] = g.level.objects[x][ny];
g.level.objects[x][ny] = otmp; g.level.objects[x][ny] = otmp;
mtmp = g.level.monsters[x][y]; mtmp = g.level.monsters[x][y];
g.level.monsters[x][y] = g.level.monsters[x][ny]; g.level.monsters[x][y] = g.level.monsters[x][ny];
g.level.monsters[x][ny] = mtmp; g.level.monsters[x][ny] = mtmp;
} }
} }
if (flp & 2) { if (flp & 2) {
for (x = minx; x < (minx + ((maxx - minx + 1) / 2)); x++) for (x = minx; x < (minx + ((maxx - minx + 1) / 2)); x++)
for (y = miny; y <= maxy; y++) { for (y = miny; y <= maxy; y++) {
int nx = FlipX(x); int nx = FlipX(x);
flip_drawbridge_horizontal(&levl[x][y]); flip_drawbridge_horizontal(&levl[x][y]);
flip_drawbridge_horizontal(&levl[nx][y]); flip_drawbridge_horizontal(&levl[nx][y]);
trm = levl[x][y]; trm = levl[x][y];
levl[x][y] = levl[nx][y]; levl[x][y] = levl[nx][y];
levl[nx][y] = trm; levl[nx][y] = trm;
otmp = g.level.objects[x][y]; otmp = g.level.objects[x][y];
g.level.objects[x][y] = g.level.objects[nx][y]; g.level.objects[x][y] = g.level.objects[nx][y];
g.level.objects[nx][y] = otmp; g.level.objects[nx][y] = otmp;
mtmp = g.level.monsters[x][y]; mtmp = g.level.monsters[x][y];
g.level.monsters[x][y] = g.level.monsters[nx][y]; g.level.monsters[x][y] = g.level.monsters[nx][y];
g.level.monsters[nx][y] = mtmp; g.level.monsters[nx][y] = mtmp;
} }
} }
/* timed effects */ /* timed effects */
@@ -3197,9 +3197,9 @@ lspo_monster(lua_State *L)
if (tmpmons.has_invent && lua_type(L, -1) == LUA_TFUNCTION) { if (tmpmons.has_invent && lua_type(L, -1) == LUA_TFUNCTION) {
lua_remove(L, -2); lua_remove(L, -2);
if (nhl_pcall(L, 0, 0)){ if (nhl_pcall(L, 0, 0)){
impossible("Lua error: %s", lua_tostring(L, -1)); impossible("Lua error: %s", lua_tostring(L, -1));
} }
spo_end_moninvent(); spo_end_moninvent();
} else } else
lua_pop(L, 1); lua_pop(L, 1);
@@ -3513,9 +3513,9 @@ lspo_object(lua_State *L)
if (lua_type(L, -1) == LUA_TFUNCTION) { if (lua_type(L, -1) == LUA_TFUNCTION) {
lua_remove(L, -2); lua_remove(L, -2);
if (nhl_pcall(L, 0, 0)){ if (nhl_pcall(L, 0, 0)){
impossible("Lua error: %s", lua_tostring(L, -1)); impossible("Lua error: %s", lua_tostring(L, -1));
} }
} else } else
lua_pop(L, 1); lua_pop(L, 1);
@@ -3825,9 +3825,9 @@ lspo_room(lua_State *L)
if (lua_type(L, -1) == LUA_TFUNCTION) { if (lua_type(L, -1) == LUA_TFUNCTION) {
lua_remove(L, -2); lua_remove(L, -2);
l_push_mkroom_table(L, tmpcr); l_push_mkroom_table(L, tmpcr);
if (nhl_pcall(L, 1, 0)){ if (nhl_pcall(L, 1, 0)){
impossible("Lua error: %s", lua_tostring(L, -1)); impossible("Lua error: %s", lua_tostring(L, -1));
} }
} else } else
lua_pop(L, 1); lua_pop(L, 1);
spo_endroom(g.coder); spo_endroom(g.coder);
@@ -5766,9 +5766,9 @@ lspo_region(lua_State *L)
lua_getfield(L, 1, "contents"); lua_getfield(L, 1, "contents");
if (lua_type(L, -1) == LUA_TFUNCTION) { if (lua_type(L, -1) == LUA_TFUNCTION) {
lua_remove(L, -2); lua_remove(L, -2);
if (nhl_pcall(L, 0, 0)){ if (nhl_pcall(L, 0, 0)){
impossible("Lua error: %s", lua_tostring(L, -1)); impossible("Lua error: %s", lua_tostring(L, -1));
} }
} else } else
lua_pop(L, 1); lua_pop(L, 1);
spo_endroom(g.coder); spo_endroom(g.coder);
@@ -6372,9 +6372,9 @@ TODO: g.coder->croom needs to be updated
if (has_contents && !(g.in_mk_themerooms && g.themeroom_failed)) { if (has_contents && !(g.in_mk_themerooms && g.themeroom_failed)) {
l_push_wid_hei_table(L, g.xsize, g.ysize); l_push_wid_hei_table(L, g.xsize, g.ysize);
if (nhl_pcall(L, 1, 0)){ if (nhl_pcall(L, 1, 0)){
impossible("Lua error: %s", lua_tostring(L, -1)); impossible("Lua error: %s", lua_tostring(L, -1));
} }
} }
return 0; return 0;
+1 -1
View File
@@ -1007,7 +1007,7 @@ ini_inv(struct trobj *trop)
int otyp, i; int otyp, i;
boolean got_sp1 = FALSE; /* got a level 1 spellbook? */ boolean got_sp1 = FALSE; /* got a level 1 spellbook? */
while (trop->trclass) { while (trop->trclass) {
otyp = (int) trop->trotyp; otyp = (int) trop->trotyp;
if (otyp != UNDEF_TYP) { if (otyp != UNDEF_TYP) {
obj = mksobj(otyp, TRUE, FALSE); obj = mksobj(otyp, TRUE, FALSE);
+1 -1
View File
@@ -651,7 +651,7 @@ hitum_cleave(
dieroll = rnd(20); dieroll = rnd(20);
mhit = (tmp > dieroll); mhit = (tmp > dieroll);
g.bhitpos.x = tx, g.bhitpos.y = ty; /* normally set up by g.bhitpos.x = tx, g.bhitpos.y = ty; /* normally set up by
do_attack() */ do_attack() */
(void) known_hitum(mtmp, uwep, &mhit, tmp, armorpenalty, (void) known_hitum(mtmp, uwep, &mhit, tmp, armorpenalty,
uattk, dieroll); uattk, dieroll);
(void) passive(mtmp, uwep, mhit, !DEADMONSTER(mtmp), AT_WEAP, !uwep); (void) passive(mtmp, uwep, mhit, !DEADMONSTER(mtmp), AT_WEAP, !uwep);
+2 -2
View File
@@ -1026,7 +1026,7 @@ static int find_glyphs(const char *id);
static void just_find_callback(int glyph, struct find_struct *findwhat); static void just_find_callback(int glyph, struct find_struct *findwhat);
static void to_unicode_callback(int glyph, struct find_struct *findwhat); static void to_unicode_callback(int glyph, struct find_struct *findwhat);
static struct customization_detail *find_display_urep_customization( static struct customization_detail *find_display_urep_customization(
const char *customization_name, int glyphidx, const char *customization_name, int glyphidx,
enum graphics_sets which_set); enum graphics_sets which_set);
void void
@@ -1045,7 +1045,7 @@ test_glyphnames(void)
static void static void
just_find_callback(int glyph UNUSED, struct find_struct *findwhat UNUSED) just_find_callback(int glyph UNUSED, struct find_struct *findwhat UNUSED)
{ {
/* nothing */ /* nothing */
} }
static int static int
find_glyphs(const char *id) find_glyphs(const char *id)
+1 -1
View File
@@ -272,7 +272,7 @@ insert_rtoption(char *buf)
for (i = 0; i < SIZE(rt_opts); ++i) { for (i = 0; i < SIZE(rt_opts); ++i) {
if (strstri(buf, rt_opts[i].token) && *rt_opts[i].value) { if (strstri(buf, rt_opts[i].token) && *rt_opts[i].value) {
(void) strsubst(buf, rt_opts[i].token, rt_opts[i].value); (void) strsubst(buf, rt_opts[i].token, rt_opts[i].value);
} }
/* we don't break out of the loop after a match; there might be /* we don't break out of the loop after a match; there might be
other matches on the same line */ other matches on the same line */
} }
+4 -4
View File
@@ -1005,8 +1005,8 @@ flip_worm_segs_vertical(struct monst *worm, int miny, int maxy)
struct wseg *curr = wtails[worm->wormno]; struct wseg *curr = wtails[worm->wormno];
while (curr) { while (curr) {
curr->wy = (maxy - curr->wy + miny); curr->wy = (maxy - curr->wy + miny);
curr = curr->nseg; curr = curr->nseg;
} }
} }
@@ -1016,8 +1016,8 @@ flip_worm_segs_horizontal(struct monst *worm, int minx, int maxx)
struct wseg *curr = wtails[worm->wormno]; struct wseg *curr = wtails[worm->wormno];
while (curr) { while (curr) {
curr->wx = (maxx - curr->wx + minx); curr->wx = (maxx - curr->wx + minx);
curr = curr->nseg; curr = curr->nseg;
} }
} }