mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-24 08:52:51 +02:00
Use transfer_part_to_pipe in special sim code that puts energy particles inside PIPE
This fixes heat and deco not being handled in line with recent changes. PIPE's update loop could also be changed to handle energy particles there. This would be better, and I might do it (compatibility risks are probably low)
This commit is contained in:
@@ -2919,12 +2919,7 @@ killed:
|
||||
|
||||
if ((TYP(r)==PT_PIPE || TYP(r) == PT_PPIP) && !TYP(parts[ID(r)].ctype))
|
||||
{
|
||||
parts[ID(r)].ctype = parts[i].type;
|
||||
parts[ID(r)].temp = parts[i].temp;
|
||||
parts[ID(r)].tmp2 = parts[i].life;
|
||||
parts[ID(r)].tmp3 = parts[i].tmp;
|
||||
parts[ID(r)].tmp4 = parts[i].ctype;
|
||||
kill_part(i);
|
||||
Element_PIPE_transfer_part_to_pipe(parts+i, parts+(ID(r)));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@@ -3,7 +3,6 @@
|
||||
#include "SOAP.h"
|
||||
|
||||
static void props_pipe_to_part(const Particle *pipe, Particle *part, bool STOR);
|
||||
static void transfer_part_to_pipe(Particle *part, Particle *pipe);
|
||||
static void transfer_pipe_to_pipe(Particle *src, Particle *dest, bool STOR);
|
||||
static void pushParticle(Simulation * sim, int i, int count, int original);
|
||||
|
||||
@@ -255,7 +254,7 @@ int Element_PIPE_update(UPDATE_FUNC_ARGS)
|
||||
{
|
||||
if (TYP(r)==PT_SOAP)
|
||||
Element_SOAP_detach(sim, ID(r));
|
||||
transfer_part_to_pipe(parts+(ID(r)), parts+i);
|
||||
Element_PIPE_transfer_part_to_pipe(parts+(ID(r)), parts+i);
|
||||
sim->kill_part(ID(r));
|
||||
}
|
||||
else if (!TYP(parts[i].ctype) && TYP(r)==PT_STOR && sd.IsElement(parts[ID(r)].tmp) && (elements[parts[ID(r)].tmp].Properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY)))
|
||||
@@ -467,7 +466,7 @@ void Element_PIPE_transfer_pipe_to_part(Simulation * sim, Particle *pipe, Partic
|
||||
}
|
||||
}
|
||||
|
||||
static void transfer_part_to_pipe(Particle *part, Particle *pipe)
|
||||
void Element_PIPE_transfer_part_to_pipe(Particle *part, Particle *pipe)
|
||||
{
|
||||
pipe->ctype = part->type;
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
|
||||
int Element_PIPE_graphics(GRAPHICS_FUNC_ARGS);
|
||||
void Element_PIPE_transfer_pipe_to_part(Simulation * sim, Particle *pipe, Particle *part, bool STOR);
|
||||
void Element_PIPE_transfer_part_to_pipe(Particle *part, Particle *pipe);
|
||||
void Element_PIPE_transformPatchOffsets(Particle &part, const std::array<int, 8> &offsetMap);
|
||||
int Element_PIPE_update(UPDATE_FUNC_ARGS);
|
||||
void Element_PPIP_flood_trigger(Simulation * sim, int x, int y, int sparkedBy);
|
||||
|
Reference in New Issue
Block a user