Skip to content

Commit

Permalink
SPRK(ETRD): Check life value of destination before conducting
Browse files Browse the repository at this point in the history
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 edf180b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/simulation/elements/SPRK.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit edf180b

Please sign in to comment.