fix another single-pixel PIPE generation issue

This commit is contained in:
jacob1
2018-09-30 23:46:52 -04:00
parent 276098f9db
commit f7e8ade347

View File

@@ -171,14 +171,12 @@ int Element_PIPE::update(UPDATE_FUNC_ARGS)
for (ry=-1; ry<2; ry++) for (ry=-1; ry<2; ry++)
if (BOUNDS_CHECK && (rx || ry)) if (BOUNDS_CHECK && (rx || ry))
{ {
count++;
r = pmap[y+ry][x+rx]; r = pmap[y+ry][x+rx];
if (!r) if (!r)
continue; continue;
if (TYP(r) != PT_PIPE && TYP(r) != PT_PPIP) if (TYP(r) != PT_PIPE && TYP(r) != PT_PPIP)
{
count++;
continue; continue;
}
unsigned int next = nextColor(parts[i].tmp); unsigned int next = nextColor(parts[i].tmp);
unsigned int prev = prevColor(parts[i].tmp); unsigned int prev = prevColor(parts[i].tmp);
if (parts[ID(r)].tmp&PFLAG_INITIALIZING) if (parts[ID(r)].tmp&PFLAG_INITIALIZING)
@@ -186,11 +184,14 @@ int Element_PIPE::update(UPDATE_FUNC_ARGS)
parts[ID(r)].tmp |= next; parts[ID(r)].tmp |= next;
parts[ID(r)].tmp &= ~PFLAG_INITIALIZING; parts[ID(r)].tmp &= ~PFLAG_INITIALIZING;
parts[ID(r)].life = 6; parts[ID(r)].life = 6;
if (parts[i].tmp&0x100)//is a single pixel pipe // Is a single pixel pipe
if (parts[i].tmp&0x100)
{ {
parts[ID(r)].tmp |= 0x200;//will transfer to a single pixel pipe // Will transfer to a single pixel pipe
parts[ID(r)].tmp |= count<<10;//coords of where it came from parts[ID(r)].tmp |= 0x200;
parts[i].tmp |= (7-count)<<14; // Coords of where it came from
parts[ID(r)].tmp |= (count - 1) << 10;
parts[i].tmp |= (8 - count) << 14;
parts[i].tmp |= 0x2000; parts[i].tmp |= 0x2000;
} }
neighborcount ++; neighborcount ++;
@@ -201,7 +202,6 @@ int Element_PIPE::update(UPDATE_FUNC_ARGS)
neighborcount ++; neighborcount ++;
lastneighbor = ID(r); lastneighbor = ID(r);
} }
count++;
} }
if (neighborcount == 1) if (neighborcount == 1)
parts[lastneighbor].tmp |= 0x100; parts[lastneighbor].tmp |= 0x100;