added some metl->wire interaction, still working on wire->metl

This commit is contained in:
lieuwe 2011-07-29 22:24:41 +08:00 committed by Simon Robertshaw
parent 8f92829aab
commit b1b3fbbc20
2 changed files with 6 additions and 1 deletions

View File

@ -42,6 +42,10 @@ int update_DLAY(UPDATE_FUNC_ARGS) {
{ {
create_part(-1, x+rx, y+ry, PT_SPRK); create_part(-1, x+rx, y+ry, PT_SPRK);
} }
else if((r&0xFF)==PT_WIRE && oldl==1)
{
parts[r>>8].ctype=1;
}
} }
//} //}
return 0; return 0;

View File

@ -22,7 +22,8 @@ int update_WIRE(UPDATE_FUNC_ARGS) {
if(x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && pmap[y+ry][x+rx] && (rx!=0 || ry!=0) && (pmap[y+ry][x+rx]&0xFF)!=0xFF) if(x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && pmap[y+ry][x+rx] && (rx!=0 || ry!=0) && (pmap[y+ry][x+rx]&0xFF)!=0xFF)
{ {
r = pmap[y+ry][x+rx]; r = pmap[y+ry][x+rx];
if((r&0xFF)==PT_SPRK){parts[s>>8].ctype=1; return 0;} if((r&0xFF)==PT_NSCN && parts[s>>8].tmp==1){create_part(-1, x+rx, y+ry, PT_SPRK);}
if((r&0xFF)==PT_SPRK && parts[r>>8].ctype==PT_PSCN){parts[s>>8].ctype=1; return 0;}
if((r&0xFF)==PT_WIRE && parts[r>>8].tmp==1){count++;} if((r&0xFF)==PT_WIRE && parts[r>>8].tmp==1){count++;}
} }
} }