Preventing creation of invalid types also prevented use of air/temp tools

This commit is contained in:
jacksonmj 2011-02-16 20:56:43 +00:00
parent 7ef2363f90
commit 29a63795dd

View File

@ -523,7 +523,7 @@ inline int create_part(int p, int x, int y, int t)
{ {
int i; int i;
if (x<0 || y<0 || x>=XRES || y>=YRES || t<0 || t>=PT_NUM) if (x<0 || y<0 || x>=XRES || y>=YRES || ((t<0 || t>=PT_NUM)&&t!=SPC_HEAT&&t!=SPC_COOL&&t!=SPC_AIR&&t!=SPC_VACUUM))
return -1; return -1;
if (t==SPC_HEAT||t==SPC_COOL) if (t==SPC_HEAT||t==SPC_COOL)