From 9a2df6b8242f27838e91adf1d2253c9090c4b7f5 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Tue, 18 Dec 2012 15:17:57 -0500 Subject: [PATCH] fix sltw + liquid rubiduim explosion, make it work like water's --- src/simulation/Elements.h | 2 +- src/simulation/elements/SLTW.cpp | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/simulation/Elements.h b/src/simulation/Elements.h index 937b4cb0c..b019ac4bb 100644 --- a/src/simulation/Elements.h +++ b/src/simulation/Elements.h @@ -39,7 +39,7 @@ #define FLAG_STAGNANT 0x1 #define FLAG_SKIPMOVE 0x2 // skip movement for one frame, only implemented for PHOT -#define FLAG_WATEREQUAL 0x4 +#define FLAG_WATEREQUAL 0x4 //if a liquid was already checked during equalization #define FLAG_MOVABLE 0x8 // if can move #define ST_NONE 0 diff --git a/src/simulation/elements/SLTW.cpp b/src/simulation/elements/SLTW.cpp index c422a9fbb..1a7586fdb 100644 --- a/src/simulation/elements/SLTW.cpp +++ b/src/simulation/elements/SLTW.cpp @@ -61,17 +61,18 @@ int Element_SLTW::update(UPDATE_FUNC_ARGS) sim->part_change_type(r>>8,x+rx,y+ry,PT_SLTW); if ((r&0xFF)==PT_PLNT&&5>(rand()%1000)) sim->kill_part(r>>8); - if (((r&0xFF)==PT_RBDM||(r&0xFF)==PT_LRBD) && !sim->legacy_enable && parts[i].temp>(273.15f+12.0f) && 1>(rand()%500)) + if (((r&0xFF)==PT_RBDM||(r&0xFF)==PT_LRBD) && (sim->legacy_enable||parts[i].temp>(273.15f+12.0f)) && 1>(rand()%500)) { sim->part_change_type(i,x,y,PT_FIRE); parts[i].life = 4; + parts[i].ctype = PT_WATR; } - if ((r&0xFF)==PT_FIRE){ + if ((r&0xFF)==PT_FIRE && parts[r>>8].ctype!=PT_WATR){ sim->kill_part(r>>8); - if(1>(rand()%150)){ - sim->kill_part(i); - return 1; - } + if(1>(rand()%150)){ + sim->kill_part(i); + return 1; + } } } return 0;