summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-10-26 20:34:24 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-10-26 20:34:24 (GMT)
commit5ab1ab8b4654fb1098a79fd0e456a90ddec5dfa5 (patch)
tree7aa1e1898bb1d0405d8d102944187062b6bd00bd /src
parente2c9882692fabcd22a7d022ebd21fd3b36ad84b0 (diff)
downloadpowder-5ab1ab8b4654fb1098a79fd0e456a90ddec5dfa5.zip
powder-5ab1ab8b4654fb1098a79fd0e456a90ddec5dfa5.tar.gz
Fix FIGH loading and bad variable names
Diffstat (limited to 'src')
-rw-r--r--src/main.c15
-rw-r--r--src/powder.c14
2 files changed, 22 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c
index 998cc40..bdccf1d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -985,11 +985,26 @@ int parse_save(void *save, int size, int replace, int x0, int y0, unsigned char
{
STKM_init_legs(&player, i-1);
player.spwn = 1;
+ player.elem = PT_DUST;
}
else if (parts[i-1].type == PT_STKM2)
{
STKM_init_legs(&player2, i-1);
player2.spwn = 1;
+ player2.elem = PT_DUST;
+ }
+ else if (parts[i-1].type == PT_FIGH)
+ {
+ unsigned char fcount = 0;
+ while (fcount < 100 && fcount < (fighcount+1) && fighters[fcount].spwn==1) fcount++;
+ if (fcount < 100 && fighters[fcount].spwn==0)
+ {
+ parts[i-1].tmp = fcount;
+ fighters[fcount].spwn = 1;
+ fighters[fcount].elem = PT_DUST;
+ fighcount++;
+ STKM_init_legs(&(fighters[fcount]), i-1);
+ }
}
if (ver<48 && (ty==OLD_PT_WIND || (ty==PT_BRAY&&parts[i-1].life==0)))
diff --git a/src/powder.c b/src/powder.c
index 3343825..59a8053 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -1029,9 +1029,9 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a
}
if (t==PT_FIGH)
{
- unsigned char cunt = 0;
- while (cunt < 100 && cunt < (fighcount+1) && fighters[cunt].spwn==1) cunt++;
- if (cunt < 100 && fighters[cunt].spwn==0)
+ unsigned char fcount = 0;
+ while (fcount < 100 && fcount < (fighcount+1) && fighters[fcount].spwn==1) fcount++;
+ if (fcount < 100 && fighters[fcount].spwn==0)
{
parts[i].x = (float)x;
parts[i].y = (float)y;
@@ -1040,11 +1040,11 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a
parts[i].vy = 0;
parts[i].life = 100;
parts[i].ctype = 0;
- parts[i].tmp = cunt;
+ parts[i].tmp = fcount;
parts[i].temp = ptypes[t].heat;
- STKM_init_legs(&fighters[cunt], i);
- fighters[cunt].spwn = 1;
- fighters[cunt].elem = PT_DUST;
+ STKM_init_legs(&fighters[fcount], i);
+ fighters[fcount].spwn = 1;
+ fighters[fcount].elem = PT_DUST;
fighcount++;
return i;