diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-12 19:16:33 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-12 19:16:33 (GMT) |
| commit | db86294e6aac5a03a2689fccb5fd4d6f10a84082 (patch) | |
| tree | e871fff512ec4c727141b7fe58ef1d15652a144d /src/simulation/Simulation.cpp | |
| parent | 9033786e4936ffcdf91011c1a02af4d48d253ebb (diff) | |
| download | powder-db86294e6aac5a03a2689fccb5fd4d6f10a84082.zip powder-db86294e6aac5a03a2689fccb5fd4d6f10a84082.tar.gz | |
TPT: Prevent allocation of particles with type==0, bleep bloop
Diffstat (limited to 'src/simulation/Simulation.cpp')
| -rw-r--r-- | src/simulation/Simulation.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index c4e6fbb..2a61e24 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -2352,7 +2352,7 @@ int Simulation::create_part(int p, int x, int y, int tv)//the function for creat int t = tv & 0xFF; int v = (tv >> 8) & 0xFF; - 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&&t!=SPC_PGRV&&t!=SPC_NGRV)) + 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&&t!=SPC_PGRV&&t!=SPC_NGRV)) return -1; if (t>=0 && t<PT_NUM && !elements[t].Enabled) return -1; |
