Make sure WIND can't be created

Revert this if the element number is reused for something useful
This commit is contained in:
jacksonmj 2011-05-14 21:46:04 +08:00 committed by Simon Robertshaw
parent e4b03fb2e2
commit 68c4d6d621
2 changed files with 9 additions and 0 deletions

View File

@ -11,6 +11,11 @@ int file_script = 0;
int console_parse_type(char *txt, int *element, char *err)
{
int i = -1;
if (strcasecmp(txt,"WIND")==0)
{
strcpy(err, "Particle type not recognised");
return 0;
}
// alternative names for some elements
if (strcasecmp(txt,"C4")==0) i = PT_PLEX;
else if (strcasecmp(txt,"C5")==0) i = PT_C5;

View File

@ -568,6 +568,8 @@ inline void part_change_type(int i, int x, int y, int t)//changes the type of pa
{
if (x<0 || y<0 || x>=XRES || y>=YRES || i>=NPART || t<0 || t>=PT_NUM)
return;
if (t==OLD_PT_WIND)
t = PT_NONE;
parts[i].type = t;
if (t==PT_PHOT || t==PT_NEUT)
{
@ -593,6 +595,8 @@ inline int create_part(int p, int x, int y, int t)//the function for creating a
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;
if (t==OLD_PT_WIND)
return -1;
if (t==SPC_HEAT||t==SPC_COOL)
{