From ccb88b6b3b1f77118e996432bdf47bbd5140c872 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Sun, 5 Feb 2012 00:30:38 +0800 Subject: [PATCH] Prevent ambient heat going through walls Still doesn't conserve energy, it might disappear when blown towards a wall, but it will no longer go through the wall. --- src/air.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/air.c b/src/air.c index 634e4b66d..958e83cd2 100644 --- a/src/air.c +++ b/src/air.c @@ -10,6 +10,7 @@ float vx[YRES/CELL][XRES/CELL], ovx[YRES/CELL][XRES/CELL]; float vy[YRES/CELL][XRES/CELL], ovy[YRES/CELL][XRES/CELL]; float pv[YRES/CELL][XRES/CELL], opv[YRES/CELL][XRES/CELL]; unsigned char bmap_blockair[YRES/CELL][XRES/CELL]; +unsigned char bmap_blockairh[YRES/CELL][XRES/CELL]; float cb_vx[YRES/CELL][XRES/CELL]; float cb_vy[YRES/CELL][XRES/CELL]; @@ -38,7 +39,12 @@ void make_kernel(void) //used for velocity void update_airh(void) { int x, y, i, j; - float dh, dx, dy, f, tx, ty; + float odh, dh, dx, dy, f, tx, ty; + for (y=0; y0 && y+j0 && x+i=2 && i=2 && j