Make TESC create LIGH with same deco color (#901)

This commit is contained in:
catsoften 2024-01-14 14:48:50 -05:00 committed by GitHub
parent 66a09ababd
commit b711b2935b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -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);
@ -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));
@ -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;
}

View File

@ -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)
{