update VIBR randoms, fix any VINE in old saves also

This commit is contained in:
jacob1 2015-01-07 19:32:49 -05:00
parent be6551ceea
commit 0ad225d1fc
2 changed files with 16 additions and 4 deletions

View File

@ -1024,6 +1024,12 @@ void GameSave::readOPS(char * data, int dataLength)
particles[newIndex].flags |= FLAG_PHOTDECO;
}
break;
case PT_VINE:
if (savedVersion < 91)
{
particles[newIndex].tmp = 1;
}
break;
}
//note: PSv was used in version 77.0 and every version before, add something in PSv too if the element is that old
newIndex++;
@ -1676,6 +1682,11 @@ void GameSave::readPSv(char * data, int dataLength)
particles[i-1].ctype = 0;
}
}
if (ver < 91)
{
if (particles[i-1].type == PT_VINE)
particles[i-1].tmp = 1;
}
}
}

View File

@ -116,18 +116,19 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) {
if (!parts[i].tmp2)
{
rndstore = rand();
sim->create_part(i, x, y, PT_EXOT);
parts[i].tmp2 = rand()%1000;
int index = sim->create_part(-3,x+((rndstore>>4)&3)-1,y+((rndstore>>6)&3)-1,PT_ELEC);
if (index != -1)
parts[index].temp = 7000;
index = sim->create_part(-3,x+((rndstore>>8)&3)-1,y+((rndstore>>10)&3)-1,PT_PHOT);
if (index != -1)
parts[index].temp = 7000;
index = sim->create_part(-1,x+((rndstore>>12)&3)-1,y+rand()%3-1,PT_BREC);
int rx = ((rndstore>>12)&3)-1;
rndstore = rand();
index = sim->create_part(-1,x+rx-1,y+rndstore%3-1,PT_BREC);
if (index != -1)
parts[index].temp = 7000;
parts[i].tmp2 = (rndstore>>16) % 1000;
sim->create_part(i, x, y, PT_EXOT);
parts[i].tmp2 = (rndstore>>2)%1000;
parts[i].temp=9000;
sim->pv[y/CELL][x/CELL] += 50;