Some work on frozen bubbles.

This commit is contained in:
savask 2011-05-27 00:18:51 +08:00 committed by Simon Robertshaw
parent a48e477fca
commit e42e7d019e

View File

@ -9,6 +9,8 @@ int update_SOAP(UPDATE_FUNC_ARGS)
//0x04 - "back" mate yes/no //0x04 - "back" mate yes/no
if ((parts[i].ctype&1) == 1) if ((parts[i].ctype&1) == 1)
{
if (parts[i].temp>0)
{ {
if (parts[i].life<=0) if (parts[i].life<=0)
{ {
@ -45,6 +47,7 @@ int update_SOAP(UPDATE_FUNC_ARGS)
parts[i].vy *= 0.5f; parts[i].vy *= 0.5f;
parts[i].vx *= 0.5f; parts[i].vx *= 0.5f;
}
if((parts[i].ctype&2) != 2) if((parts[i].ctype&2) != 2)
{ {
@ -89,16 +92,20 @@ int update_SOAP(UPDATE_FUNC_ARGS)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry)) if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{ {
r = pmap[y+ry][x+rx]; r = pmap[y+ry][x+rx];
if ((r>>8)>=NPART || !r) if (((r>>8)>=NPART || !r) && !bmap[(y+ry)/CELL][(x+rx)/CELL])
continue; continue;
if (((r&0xFF) != PT_SOAP && (r&0xFF) != PT_GLAS) if (parts[i].temp>0)
{
if (bmap[(y+ry)/CELL][(x+rx)/CELL]
|| ((r&0xFF) != PT_SOAP && (r&0xFF) != PT_GLAS)
|| (parts[r>>8].ctype == 0 && (r&0xFF) == PT_SOAP || (parts[r>>8].ctype == 0 && (r&0xFF) == PT_SOAP
&& (abs(parts[r>>8].vx)<2 || abs(parts[r>>8].vy)<2))) && (abs(parts[r>>8].vx)<2 || abs(parts[r>>8].vy)<2)))
{ {
detach(i); detach(i);
continue; continue;
} }
}
if ((r&0xFF) == PT_SOAP && parts[r>>8].ctype == 1) if ((r&0xFF) == PT_SOAP && parts[r>>8].ctype == 1)
{ {