diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-09-14 21:23:35 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-09-14 21:23:35 (GMT) |
| commit | 5b9032fb3fe8e2f52134dc570a7ae358ed659a4a (patch) | |
| tree | 9d190273c4a393e88de0e470fce67f432bebfd11 /src/simulation/Simulation.cpp | |
| parent | 486b34ebe581cf41b67145911a64ce2ea7b8932a (diff) | |
| download | powder-5b9032fb3fe8e2f52134dc570a7ae358ed659a4a.zip powder-5b9032fb3fe8e2f52134dc570a7ae358ed659a4a.tar.gz | |
Correct initialisation of FIGH
Diffstat (limited to 'src/simulation/Simulation.cpp')
| -rw-r--r-- | src/simulation/Simulation.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 195676c..85b65b8 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -81,30 +81,33 @@ int Simulation::Load(int fullX, int fullY, GameSave * save) elementCount[tempPart.type]++; } - if (tempPart.type == PT_STKM) + if (parts[i].type == PT_STKM) { Element_STKM::STKM_init_legs(this, &player, i); player.spwn = 1; player.elem = PT_DUST; } - else if (tempPart.type == PT_STKM2) + else if (parts[i].type == PT_STKM2) { Element_STKM::STKM_init_legs(this, &player2, i); player2.spwn = 1; player2.elem = PT_DUST; } - else if (tempPart.type == PT_FIGH) + else if (parts[i].type == PT_FIGH) { //TODO: 100 should be replaced with a macro - unsigned char fcount = 0; - while (fcount < 100 && fcount < (fighcount+1) && fighters[fcount].spwn==1) fcount++; - if (fcount < 100 && fighters[fcount].spwn==0) + for(int fcount = 0; fcount < 100; fcount++) { - tempPart.tmp = fcount; - fighters[fcount].spwn = 1; - fighters[fcount].elem = PT_DUST; - fighcount++; - Element_STKM::STKM_init_legs(this, &(fighters[fcount]), i); + if(!fighters[fcount].spwn) + { + fighcount++; + //currentPart.tmp = fcount; + parts[i].tmp = fcount; + fighters[fcount].spwn = 1; + fighters[fcount].elem = PT_DUST; + Element_STKM::STKM_init_legs(this, &(fighters[fcount]), i); + break; + } } } } |
