From 3cae63c733767394ebb8dbc2ad2481a8a60bca13 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Mon, 5 Nov 2012 14:18:28 +0000 Subject: [PATCH] VIBR: don't dump heat into elements that don't conduct heat, and put any remaining heat into EXOT at the end of the explosion --- src/simulation/elements/VIBR.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/simulation/elements/VIBR.cpp b/src/simulation/elements/VIBR.cpp index 35ba93061..25f7a41c9 100644 --- a/src/simulation/elements/VIBR.cpp +++ b/src/simulation/elements/VIBR.cpp @@ -142,7 +142,7 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) { if(x+rx>=0 && y+ry>0 && x+rxelements[r&0xFF].HeatConduct && ((r&0xFF)!=PT_HSWC||parts[r>>8].life==10)) { parts[r>>8].temp += parts[i].tmp*3; parts[i].tmp = 0; @@ -153,8 +153,10 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) { if (parts[i].life == 1) { int random = rand(), index; + float temperature = parts[i].temp + parts[i].tmp*3; sim->create_part(i, x, y, PT_EXOT); parts[i].tmp2 = rand()%1000; + parts[i].temp = temperature; index = sim->create_part(-3,x+((random>>4)&3)-1,y+((random>>6)&3)-1,PT_ELEC); if (index != -1) parts[index].temp = 7000; @@ -166,6 +168,8 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) { parts[index].temp = 7000; parts[i].temp=9000; sim->pv[y/CELL][x/CELL] += 50; + + return 1; } } //Neighbor check loop @@ -188,7 +192,7 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) { sim->part_change_type(i,x,y,PT_BVBR); sim->pv[y/CELL][x/CELL] -= 1; } - else if (parts[i].life && (r&0xFF) == parts[i].type && !parts[r>>8].life) + else if (parts[i].life && ((r&0xFF)==PT_VIBR || (r&0xFF)==PT_BVBR) && !parts[r>>8].life) { parts[r>>8].tmp += 10; }