Fix some WIND bugs
This commit is contained in:
commit
7d56b33589
@ -10,7 +10,7 @@
|
||||
#define SAVE_VERSION 46
|
||||
#define MINOR_VERSION 4
|
||||
#define IDENT_VERSION "G" //Change this if you're not Simon! It should be a single letter.
|
||||
//#define BETA
|
||||
#define BETA
|
||||
|
||||
#define SERVER "powdertoy.co.uk"
|
||||
|
||||
|
@ -6,8 +6,8 @@ int update_PRTO(UPDATE_FUNC_ARGS) {
|
||||
parts[i].tmp = (int)((parts[i].temp-73.15f)/100+1);
|
||||
if (parts[i].tmp>=CHANNELS) parts[i].tmp = CHANNELS-1;
|
||||
else if (parts[i].tmp<0) parts[i].tmp = 0;
|
||||
for (rx=1; rx>-2; rx--)
|
||||
for (ry=1; ry>-2; ry--)
|
||||
for (rx=-1; rx<2; rx++)
|
||||
for (ry=-1; ry<2; ry++)
|
||||
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
|
||||
{
|
||||
r = pmap[y+ry][x+rx];
|
||||
|
15
src/main.c
15
src/main.c
@ -2301,8 +2301,18 @@ int main(int argc, char *argv[])
|
||||
svf_description[0] = 0;
|
||||
gravityMode = 0;
|
||||
airMode = 0;
|
||||
|
||||
death = death2 = 0;
|
||||
isplayer2 = 0;
|
||||
isplayer = 0;
|
||||
ISSPAWN1 = 0;
|
||||
ISSPAWN2 = 0;
|
||||
|
||||
memset(fire_bg, 0, XRES*YRES*PIXELSIZE);
|
||||
memset(pers_bg, 0, (XRES+BARSIZE)*YRES*PIXELSIZE);
|
||||
memset(fire_r, 0, sizeof(fire_r));
|
||||
memset(fire_g, 0, sizeof(fire_g));
|
||||
memset(fire_b, 0, sizeof(fire_b));
|
||||
}
|
||||
if (x>=(XRES+BARSIZE-(510-385)) && x<=(XRES+BARSIZE-(510-476)))
|
||||
{
|
||||
@ -2461,7 +2471,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
if (sdl_mod & (KMOD_CAPS))
|
||||
c = 0;
|
||||
if (c!=WL_STREAM+100&&c!=SPC_AIR&&c!=SPC_HEAT&&c!=SPC_COOL&&c!=SPC_VACUUM&&c!=PT_WIND&&!REPLACE_MODE)
|
||||
if (c!=WL_STREAM+100&&c!=SPC_AIR&&c!=SPC_HEAT&&c!=SPC_COOL&&c!=SPC_VACUUM&&!REPLACE_MODE&&c!=PT_WIND)
|
||||
flood_parts(x, y, c, -1, -1);
|
||||
if (c==SPC_HEAT || c==SPC_COOL)
|
||||
create_parts(x, y, bsx, bsy, c);
|
||||
@ -2809,7 +2819,8 @@ int process_command(pixel *vid_buf,char *console,char *console_error) {
|
||||
ny = 0;
|
||||
j = 0;
|
||||
m = 0;
|
||||
console_parse_coords(console4, &nx , &ny, console_error);
|
||||
if(console4)
|
||||
console_parse_coords(console4, &nx , &ny, console_error);
|
||||
memset(pch,0,sizeof(pch));
|
||||
memset(fileread,0,sizeof(fileread));
|
||||
fread(fileread,1,5000,f);
|
||||
|
@ -1122,7 +1122,7 @@ int nearest_part(int ci, int t)
|
||||
|
||||
void update_particles_i(pixel *vid, int start, int inc)
|
||||
{
|
||||
int i, j, x, y, t, nx, ny, r, surround_space, s, lt, rt, nt, nnx, nny, q, golnum, goldelete, z, neighbors;
|
||||
int i, j, x, y, t, nx, ny, r, surround_space, s, lt, rt, nt, nnx, nny, q, golnum, goldelete, z, neighbors, createdsomething;
|
||||
float mv, dx, dy, ix, iy, lx, ly, nrx, nry, dp, ctemph, ctempl;
|
||||
int fin_x, fin_y, clear_x, clear_y;
|
||||
float fin_xf, fin_yf, clear_xf, clear_yf;
|
||||
@ -1329,14 +1329,14 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
if(neighbors==0 || !(ptypes[r&0xFF].properties&PROP_LIFE || !(r&0xFF)) || (r>>8)>=NPART)
|
||||
continue;
|
||||
for ( golnum = 1; golnum<=NGOL; golnum++)
|
||||
for ( goldelete = 0; goldelete<9; goldelete++)
|
||||
{
|
||||
if (neighbors==goldelete&&gol[nx][ny]==0&&grule[golnum][goldelete]>=2&&gol2[nx][ny][golnum]>=(goldelete%2)+goldelete/2)
|
||||
goldelete = neighbors;
|
||||
if (gol[nx][ny]==0&&grule[golnum][goldelete]>=2&&gol2[nx][ny][golnum]>=(goldelete%2)+goldelete/2)
|
||||
{
|
||||
if (create_part(-1,nx,ny,goltype[golnum-1]))
|
||||
createdsomething = 1;
|
||||
}
|
||||
else if (neighbors-1==goldelete&&gol[nx][ny]==golnum&&(grule[golnum][goldelete]==0||grule[golnum][goldelete]==2))//subtract 1 because it counted itself
|
||||
else if (gol[nx][ny]==golnum&&(grule[golnum][goldelete-1]==0||grule[golnum][goldelete-1]==2))//subtract 1 because it counted itself
|
||||
{
|
||||
if(parts[r>>8].tmp==grule[golnum][9]-1)
|
||||
parts[r>>8].tmp --;
|
||||
|
Reference in New Issue
Block a user