From edf180b94e82b4e1caa0b8bff504ec5547be5bc9 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Fri, 18 Dec 2015 23:36:01 +0000 Subject: [PATCH] SPRK(ETRD): Check life value of destination before conducting This prevents ETRD conducting to neighbours which are still in the cooldown period after the previous spark. This is for consistency with all other conduction rules, and to prevent behaviour being dependent on particle order. --- src/simulation/elements/SPRK.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/simulation/elements/SPRK.cpp b/src/simulation/elements/SPRK.cpp index a8a9cfdf2..5374be564 100644 --- a/src/simulation/elements/SPRK.cpp +++ b/src/simulation/elements/SPRK.cpp @@ -335,7 +335,7 @@ int Element_SPRK::update(UPDATE_FUNC_ARGS) if (parts[r>>8].temp+10.0f<673.0f&&!sim->legacy_enable&&(receiver==PT_METL||receiver==PT_BMTL||receiver==PT_BRMT||receiver==PT_PSCN||receiver==PT_NSCN||receiver==PT_ETRD||receiver==PT_NBLE||receiver==PT_IRON)) parts[r>>8].temp = parts[r>>8].temp+10.0f; } - else if (sender==PT_ETRD && parts[i].life==5) //ETRD is odd and conducts to others only at life 5, this could probably be somewhere else + else if (!parts[r>>8].life && sender==PT_ETRD && parts[i].life==5) //ETRD is odd and conducts to others only at life 5, this could probably be somewhere else { sim->part_change_type(i,x,y,sender); parts[i].ctype = PT_NONE;