Fix gravmap memset, and restrict_flt for temperatures
This commit is contained in:
parent
ad2b000a8a
commit
23d6823bc3
@ -45,12 +45,12 @@ int update_BANG(UPDATE_FUNC_ARGS) {
|
||||
if(!(rand()%2))
|
||||
{
|
||||
create_part(i, x, y, PT_FIRE);
|
||||
parts[i].temp = (MAX_TEMP/4)+otemp;
|
||||
parts[i].temp = restrict_flt((MAX_TEMP/4)+otemp, MIN_TEMP, MAX_TEMP);
|
||||
}
|
||||
else
|
||||
{
|
||||
create_part(i, x, y, PT_SMKE);
|
||||
parts[i].temp = (MAX_TEMP/4)+otemp;
|
||||
parts[i].temp = restrict_flt((MAX_TEMP/4)+otemp, MIN_TEMP, MAX_TEMP);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -60,7 +60,7 @@ int update_BANG(UPDATE_FUNC_ARGS) {
|
||||
create_part(i, x, y, PT_BOMB);
|
||||
parts[i].tmp = 1;
|
||||
parts[i].life = 50;
|
||||
parts[i].temp = (MAX_TEMP/3)+otemp;
|
||||
parts[i].temp = restrict_flt((MAX_TEMP/3)+otemp, MIN_TEMP, MAX_TEMP);
|
||||
parts[i].vx = rand()%20-10;
|
||||
parts[i].vy = rand()%20-10;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ int update_IGNT(UPDATE_FUNC_ARGS) {
|
||||
parts[nb].life = 30;
|
||||
parts[nb].vx = rand()%20-10;
|
||||
parts[nb].vy = rand()%20-10;
|
||||
parts[nb].temp = 400.0f+parts[i].temp-273.15;
|
||||
parts[nb].temp = restrict_flt(400.0f+parts[i].temp-273.15, MIN_TEMP, MAX_TEMP);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1865,7 +1865,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
gravity_update_async(); //Check for updated velocity maps from gravity thread
|
||||
if (!sys_pause||framerender) //Only update if not paused
|
||||
memset(gravmap, 0, sizeof(gravmap)); //Clear the old gravmap
|
||||
memset(gravmap, 0, (XRES/CELL)*(YRES/CELL)*sizeof(float)); //Clear the old gravmap
|
||||
|
||||
if (framerender) {
|
||||
framerender = 0;
|
||||
|
Reference in New Issue
Block a user