Skip to content

Commit

Permalink
Make TESC create LIGH with same deco color (#901)
Browse files Browse the repository at this point in the history
  • Loading branch information
catsoften committed Jan 14, 2024
1 parent 66a09ab commit b711b29
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/simulation/elements/LIGH.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "simulation/ElementCommon.h"

#include "graphics/Pixel.h"

static int update(UPDATE_FUNC_ARGS);
static int graphics(GRAPHICS_FUNC_ARGS);
static void create(ELEMENT_CREATE_FUNC_ARGS);
Expand Down Expand Up @@ -195,6 +197,7 @@ static bool create_LIGH(Simulation * sim, int x, int y, int c, float temp, int l
{
sim->parts[p].temp = float(temp);
sim->parts[p].tmp = tmp;
sim->parts[p].dcolour = sim->parts[i].dcolour;
if (last)
{
int nextSegmentLife = (int)(life/1.5 - sim->rng.between(0, 1));
Expand Down Expand Up @@ -299,7 +302,7 @@ static int graphics(GRAPHICS_FUNC_ARGS)
*firer = *colr = 235;
*fireg = *colg = 245;
*fireb = *colb = 255;
*pixel_mode |= PMODE_GLOW | FIRE_ADD;
*pixel_mode |= PMODE_GLOW | FIRE_ADD | DECO_FIRE;
return 1;
}

Expand Down
1 change: 1 addition & 0 deletions src/simulation/elements/SPRK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ static int update(UPDATE_FUNC_ARGS)
parts[p].temp=parts[p].life*parts[i].tmp/2.5;
parts[p].tmp2=1;
parts[p].tmp=int(atan2(-ry, (float)rx)/TPT_PI_FLT*360);
parts[p].dcolour = parts[i].dcolour;
parts[i].temp-=parts[i].tmp*2+parts[i].temp/5; // slight self-cooling
if (fabs(sim->pv[y/CELL][x/CELL])!=0.0f)
{
Expand Down

0 comments on commit b711b29

Please sign in to comment.