Simulation::create_part sanity check
This commit is contained in:
parent
323a850e16
commit
4efe5875ab
@ -3112,9 +3112,7 @@ int Simulation::create_part(int p, int x, int y, int t, int v)
|
||||
{
|
||||
int i, oldType = PT_NONE;
|
||||
|
||||
if (x<0 || y<0 || x>=XRES || y>=YRES)
|
||||
return -1;
|
||||
if (t>=0 && t<PT_NUM && !elements[t].Enabled)
|
||||
if (x<0 || y<0 || x>=XRES || y>=YRES || t<=0 || t>=PT_NUM || !elements[t].Enabled)
|
||||
return -1;
|
||||
|
||||
if (t == PT_SPRK && !(p == -2 && elements[TYP(pmap[y][x])].CtypeDraw))
|
||||
|
Loading…
Reference in New Issue
Block a user