* game and editor: emit a warning when a search-path directory specified

on the command-line isn't found (instead of saying nothing)
* editor: Move inconsistent (stat&2)/heinum detection into the corruption
  checker. This makes a lot of original maps spew countless 'errors', but
  it's preferable for new maps since such floors and ceilings could behave
  strangely with TROR.

git-svn-id: https://svn.eduke32.com/eduke32@1995 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2011-09-01 18:37:53 +00:00
parent 317aca0093
commit b72d351f20
4 changed files with 48 additions and 71 deletions

View file

@ -5801,9 +5801,9 @@ check_next_sector: ;
sector[numsectors].extra = -1; sector[numsectors].extra = -1;
sector[numsectors].lotag = sector[numsectors].hitag = 0; sector[numsectors].lotag = sector[numsectors].hitag = 0;
sector[numsectors].ceilingstat &= ~2; setslope(numsectors, YAX_CEILING, 0);
sector[numsectors].floorstat &= ~2; setslope(numsectors, YAX_FLOOR, 0);
sector[numsectors].ceilingheinum = sector[numsectors].floorheinum = 0;
sector[numsectors].ceilingpal = sector[numsectors].floorpal = 0; sector[numsectors].ceilingpal = sector[numsectors].floorpal = 0;
#ifdef YAX_ENABLE #ifdef YAX_ENABLE
yax_setbunches(numsectors, -1, -1); yax_setbunches(numsectors, -1, -1);

View file

@ -1195,52 +1195,6 @@ defstate chselshade
} }
ends ends
defstate correctslopes
"Correct cstat&2/heinum"
for i allsectors
{
set j sector[i].ceilingstat, and j 2
ife j 2
{
ife sector[i].ceilingheinum 0
{
sub sector[i].ceilingstat 2
qsprintf TQUOTE "sec %d ceilingstat cleared bit 2" i
quote TQUOTE
}
}
else
{
ifn sector[i].ceilingheinum 0
{
set sector[i].ceilingheinum 0
qsprintf TQUOTE "sec %d ceilingheinum set to 0" i
quote TQUOTE
}
}
set j sector[i].floorstat, and j 2
ife j 2
{
ife sector[i].floorheinum 0
{
sub sector[i].floorstat 2
qsprintf TQUOTE "sec %d floorstat cleared bit 2" i
quote TQUOTE
}
}
else
{
ifn sector[i].floorheinum 0
{
set sector[i].floorheinum 0
qsprintf TQUOTE "sec %d floorheinum set to 0" i
quote TQUOTE
}
}
}
ends
////////// USER AREA ////////// ////////// USER AREA //////////
// key settings // key settings

View file

@ -5337,15 +5337,8 @@ static void Keys3d(void)
break; break;
} }
if (sector[searchsector].ceilingheinum == 0) setslope(searchsector, YAX_CEILING, sector[searchsector].ceilingheinum);
sector[searchsector].ceilingstat &= ~2; setslope(searchsector, YAX_FLOOR, sector[searchsector].floorheinum);
else
sector[searchsector].ceilingstat |= 2;
if (sector[searchsector].floorheinum == 0)
sector[searchsector].floorstat &= ~2;
else
sector[searchsector].floorstat |= 2;
asksave = 1; asksave = 1;
noclip = i; noclip = i;
@ -6538,7 +6531,8 @@ static void Keys3d(void)
(bunchnum < 0 || YAXSLOPECHK(searchsector, othersidesect))) (bunchnum < 0 || YAXSLOPECHK(searchsector, othersidesect)))
#endif #endif
{ {
int32_t newslope = clamp(AIMED_CEILINGFLOOR(heinum) + tsign*i, -BHEINUM_MAX, BHEINUM_MAX); int32_t oldslope = (AIMED_CEILINGFLOOR(stat)&2) ? AIMED_CEILINGFLOOR(heinum) : 0;
int32_t newslope = clamp(oldslope + tsign*i, -BHEINUM_MAX, BHEINUM_MAX);
setslope(searchsector, AIMING_AT_FLOOR, newslope); setslope(searchsector, AIMING_AT_FLOOR, newslope);
#ifdef YAX_ENABLE #ifdef YAX_ENABLE
@ -6549,17 +6543,7 @@ static void Keys3d(void)
typestr[searchstat], AIMED_CEILINGFLOOR(heinum)); typestr[searchstat], AIMED_CEILINGFLOOR(heinum));
} }
} }
/*
if (sector[searchsector].ceilingheinum == 0)
sector[searchsector].ceilingstat &= ~2;
else
sector[searchsector].ceilingstat |= 2;
if (sector[searchsector].floorheinum == 0)
sector[searchsector].floorstat &= ~2;
else
sector[searchsector].floorstat |= 2;
*/
asksave = 1; asksave = 1;
} }
@ -10258,7 +10242,12 @@ int32_t ExtInit(void)
while (CommandPaths) while (CommandPaths)
{ {
s = CommandPaths->next; s = CommandPaths->next;
addsearchpath(CommandPaths->str); i = addsearchpath(CommandPaths->str);
if (i < 0)
{
initprintf("Failed adding %s for game data: %s\n", CommandPaths->str,
i==-1 ? "not a directory" : "no such directory");
}
Bfree(CommandPaths->str); Bfree(CommandPaths->str);
Bfree(CommandPaths); Bfree(CommandPaths);
@ -11443,6 +11432,33 @@ int32_t CheckMapCorruption(int32_t printfromlev, uint64_t tryfixing)
if (endwall > numwalls) if (endwall > numwalls)
CORRUPTCHK_PRINT(4, CORRUPT_SECTOR|i, "SECTOR[%d]: wallptr+wallnum=%d out of range: numwalls=%d", i, endwall, numwalls); CORRUPTCHK_PRINT(4, CORRUPT_SECTOR|i, "SECTOR[%d]: wallptr+wallnum=%d out of range: numwalls=%d", i, endwall, numwalls);
// inconsistent cstat&2 and heinum checker
{
int32_t cs, hn;
const char *cflabel[2] = {"ceiling", "floor"};
for (j=0; j<2; j++)
{
cs = !!(SECTORFLD(i,stat, j)&2);
hn = (SECTORFLD(i,heinum, j)!=0);
if (cs != hn)
{
if (numcorruptthings < MAXCORRUPTTHINGS && (tryfixing & (1ull<<numcorruptthings)))
{
setslope(i, j, 0);
OSD_Printf(CCHK_CORRECTED "auto-correction: reset sector %d's %s slope\n",
i, cflabel[j]);
}
else
{
CORRUPTCHK_PRINT(2, CORRUPT_SECTOR|i,
"SECTOR[%d]: inconsistent %sstat&2 and heinum", i, cflabel[j]);
}
}
}
}
errlevel = max(errlevel, bad); errlevel = max(errlevel, bad);
if (bad<4) if (bad<4)
@ -11951,6 +11967,7 @@ static void EditSectorData(int16_t sectnum)
case 5: case 5:
handlemed(0, "Ceiling heinum", "Ceiling Heinum", &sector[sectnum].ceilingheinum, handlemed(0, "Ceiling heinum", "Ceiling Heinum", &sector[sectnum].ceilingheinum,
sizeof(sector[sectnum].ceilingheinum), BHEINUM_MAX, 1); sizeof(sector[sectnum].ceilingheinum), BHEINUM_MAX, 1);
setslope(sectnum, YAX_CEILING, sector[sectnum].ceilingheinum);
break; break;
case 6: case 6:
handlemed(0, "Palookup number", "Ceiling Palookup Number", &sector[sectnum].ceilingpal, handlemed(0, "Palookup number", "Ceiling Palookup Number", &sector[sectnum].ceilingpal,
@ -12002,6 +12019,7 @@ static void EditSectorData(int16_t sectnum)
case 5: case 5:
handlemed(0, "Floor heinum", "Floor Heinum", &sector[sectnum].floorheinum, handlemed(0, "Floor heinum", "Floor Heinum", &sector[sectnum].floorheinum,
sizeof(sector[sectnum].floorheinum), BHEINUM_MAX, 1); sizeof(sector[sectnum].floorheinum), BHEINUM_MAX, 1);
setslope(sectnum, YAX_FLOOR, sector[sectnum].floorheinum);
break; break;
case 6: case 6:
handlemed(0, "Palookup number", "Floor Palookup Number", &sector[sectnum].floorpal, handlemed(0, "Palookup number", "Floor Palookup Number", &sector[sectnum].floorpal,

View file

@ -9701,7 +9701,12 @@ int32_t app_main(int32_t argc,const char **argv)
while (CommandPaths) while (CommandPaths)
{ {
s = CommandPaths->next; s = CommandPaths->next;
addsearchpath(CommandPaths->str); i = addsearchpath(CommandPaths->str);
if (i < 0)
{
initprintf("Failed adding %s for game data: %s\n", CommandPaths->str,
i==-1 ? "not a directory" : "no such directory");
}
Bfree(CommandPaths->str); Bfree(CommandPaths->str);
Bfree(CommandPaths); Bfree(CommandPaths);