Permalink
Browse files

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.
  • Loading branch information...
jacksonmj committed Dec 18, 2015
1 parent 37eb674 commit edf180b94e82b4e1caa0b8bff504ec5547be5bc9
Showing with 1 addition and 1 deletion.
  1. +1 −1 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;

0 comments on commit edf180b

Please sign in to comment.