mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
- In the editor, make bunch-equal-making [J] stricter, because the way it was
handled could lead to a bunch whose floors and ceilings covered different areas. A fix for the reduced functionality arising from this change is underway. - Rewrite a small portion of code using yax_vnextsec() in game.c. git-svn-id: https://svn.eduke32.com/eduke32@2019 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
7f1133a493
commit
24cbd241d7
3 changed files with 40 additions and 22 deletions
|
@ -4961,7 +4961,7 @@ end_point_dragging:
|
|||
}
|
||||
else
|
||||
{
|
||||
int32_t joink, s1to0wall;
|
||||
int32_t joink, s1to0wall, s0to1wall;
|
||||
#ifdef YAX_ENABLE
|
||||
int16_t jbn[2][2]; // [join index][c/f]
|
||||
int32_t uneqbn; // unequal bunchnums (bitmap): 1:above, 2:below
|
||||
|
@ -4975,6 +4975,7 @@ end_point_dragging:
|
|||
if (inside_editor_curpos(i) == 1)
|
||||
{
|
||||
s1to0wall = find_nextwall(i, joinsector[0]);
|
||||
s0to1wall = wall[s1to0wall].nextwall;
|
||||
joinsector[1] = i;
|
||||
#ifdef YAX_ENABLE
|
||||
for (k=0; k<2; k++)
|
||||
|
@ -5011,12 +5012,18 @@ end_point_dragging:
|
|||
|
||||
if (uneqbn == 1)
|
||||
{
|
||||
message("Can't join two sectors with different ceiling bunchnums."
|
||||
" To make them equal, join their upper neighbor's floors.");
|
||||
OSD_Printf("Can't join two sectors with different ceiling bunchnums."
|
||||
" To make them equal, join their upper neighbor's floors.");
|
||||
printmessage16("Can't join two sectors with different ceiling bunchnums. See OSD");
|
||||
joinsector[0] = joinsector[1] = -1;
|
||||
goto end_join_sectors;
|
||||
}
|
||||
if (s0to1wall < 0)
|
||||
{
|
||||
printmessage16("INTERNAL ERROR: nextwalls inconsistent!");
|
||||
joinsector[0] = joinsector[1] = -1;
|
||||
goto end_join_sectors;
|
||||
}
|
||||
|
||||
// both must be extended
|
||||
if (jbn[0][cf]<0 || jbn[1][cf]<0)
|
||||
|
@ -5030,31 +5037,34 @@ end_point_dragging:
|
|||
|
||||
// check whether the lower neighbors have a red-wall link to each other
|
||||
jsynw[1] = yax_getnextwall(s1to0wall, cf);
|
||||
jsynw[0] = yax_getnextwall(wall[s1to0wall].nextwall, cf);
|
||||
jsynw[0] = yax_getnextwall(s0to1wall, cf);
|
||||
if (jsynw[0]<0 || jsynw[1]<0) // this shouldn't happen
|
||||
uneqbn &= ~(1<<cf), whybad|=8;
|
||||
else if (wall[jsynw[1]].nextwall != jsynw[0])
|
||||
{
|
||||
if (find_nextwall(sectorofwall(jsynw[1]), sectorofwall(jsynw[0])) < 0)
|
||||
// if (find_nextwall(sectorofwall(jsynw[1]), sectorofwall(jsynw[0])) < 0)
|
||||
uneqbn &= ~(1<<cf), whybad|=16;
|
||||
}
|
||||
|
||||
if ((uneqbn&2)==0)
|
||||
{
|
||||
if (whybad==1+8 && jbn[0][cf]>=0 && jbn[1][cf]<0)
|
||||
if (0) //(whybad==1+8 && jbn[0][cf]>=0 && jbn[1][cf]<0)
|
||||
{
|
||||
// 1st join sector extended, 2nd not... let's see
|
||||
// if the latter is inner to the former one
|
||||
|
||||
m = 1;
|
||||
for (WALLS_OF_SECTOR(joinsector[1], k))
|
||||
if (wall[k].nextsector != joinsector[0])
|
||||
{
|
||||
m = 0;
|
||||
break;
|
||||
}
|
||||
int32_t lowerstartsec = yax_vnextsec(s0to1wall, cf);
|
||||
|
||||
if (m==1)
|
||||
m = (lowerstartsec < 0)<<1;
|
||||
for (WALLS_OF_SECTOR(joinsector[1], k))
|
||||
{
|
||||
if (m) break;
|
||||
|
||||
m |= (wall[k].nextsector>=0 && wall[k].nextsector != joinsector[0]);
|
||||
m |= (wall[k].nextwall>=0 && yax_vnextsec(wall[k].nextwall, cf)!=lowerstartsec)<<1;
|
||||
}
|
||||
|
||||
if (m==0)
|
||||
{
|
||||
yax_setbunch(joinsector[1], YAX_FLOOR, jbn[0][cf]);
|
||||
yax_update(0);
|
||||
|
@ -5066,8 +5076,16 @@ end_point_dragging:
|
|||
}
|
||||
else
|
||||
{
|
||||
printmessage16("Can't add sector %d's floor to bunch %d: not inner to sector %d",
|
||||
joinsector[1], jbn[0][cf], joinsector[0]);
|
||||
if (m&1)
|
||||
{
|
||||
message("Can't add sector %d's floor to bunch %d: not inner to sector %d",
|
||||
joinsector[1], jbn[0][cf], joinsector[0]);
|
||||
}
|
||||
else // if (m&2)
|
||||
{
|
||||
message("Can't add sector %d's floor to bunch %d: must have lower neighbor",
|
||||
joinsector[1], jbn[0][cf]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -5596,18 +5596,18 @@ int32_t A_Spawn(int32_t j, int32_t pn)
|
|||
|
||||
if (outerwall >= 0)
|
||||
{
|
||||
int32_t upperwall = yax_getnextwall(outerwall, YAX_CEILING);
|
||||
int32_t uppersect = yax_vnextsec(outerwall, YAX_CEILING);
|
||||
|
||||
if (upperwall>=0 && wall[upperwall].nextsector>=0)
|
||||
if (uppersect >= 0)
|
||||
{
|
||||
int32_t jj, uppersect=wall[upperwall].nextsector;
|
||||
int32_t jj;
|
||||
for (jj=headspritesect[uppersect]; jj>=0; jj=nextspritesect[jj])
|
||||
if (sprite[jj].picnum==SECTOREFFECTOR && sprite[jj].lotag==sp->lotag)
|
||||
break;
|
||||
if (jj < 0)
|
||||
{
|
||||
Sect_SetInterpolation(wall[upperwall].nextsector);
|
||||
actor[i].t_data[9] = wall[upperwall].nextsector;
|
||||
Sect_SetInterpolation(uppersect);
|
||||
actor[i].t_data[9] = uppersect;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -768,7 +768,7 @@ REDODOOR:
|
|||
i = headspritesect[sn];
|
||||
while (i >= 0)
|
||||
{
|
||||
if (sprite[i].statnum == 3 && SLT==9)
|
||||
if (sprite[i].statnum == STAT_EFFECTOR && SLT==9)
|
||||
{
|
||||
j = SZ;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue