From ef777b92dc68364f064978839c25f8f4d8bf343a Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Tue, 12 Jun 2012 21:28:37 +0100 Subject: [PATCH] TPT: Put ifs into switch in create_part --- src/simulation/Simulation.cpp | 405 ++++++++++++++++--------------- src/simulation/elements/SOAP.cpp | 4 +- 2 files changed, 214 insertions(+), 195 deletions(-) diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 2a61e2452..083d9f6f0 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -2546,202 +2546,221 @@ int Simulation::create_part(int p, int x, int y, int tv)//the function for creat parts[i].tmp = 0; parts[i].tmp2 = 0; } - if (t==PT_LIGH && p==-2) - { - switch (gravityMode) - { - default: - case 0: - parts[i].tmp= 270+rand()%40-20; - break; - case 1: - parts[i].tmp = rand()%360; - break; - case 2: - parts[i].tmp = atan2(x-XCNTR, y-YCNTR)*(180.0f/M_PI)+90; - break; - } - parts[i].tmp2 = 4; - } - if (t==PT_SOAP) - { - parts[i].tmp = -1; - parts[i].tmp2 = -1; - } - //now set various properties that we want at spawn. - if (t==PT_ACID || t==PT_CAUS) - { - parts[i].life = 75; - } - /*Testing - if(t==PT_WOOD){ - parts[i].life = 150; - } - End Testing*/ - if (t==PT_WARP) { - parts[i].life = rand()%95+70; - } - if (t==PT_FUSE) { - parts[i].life = 50; - parts[i].tmp = 50; - } - /*if (elements[t].Properties&PROP_LIFE) { - int r; - for (r = 0; r