2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
// VaporizeFluidSimulator.cpp
|
|
|
|
|
|
|
|
// Implements the cVaporizeFluidSimulator class representing a fluid simulator that replaces all fluid blocks with air
|
|
|
|
|
|
|
|
#include "Globals.h"
|
|
|
|
#include "VaporizeFluidSimulator.h"
|
2018-07-24 17:30:49 -04:00
|
|
|
#include "../OpaqueWorld.h"
|
2013-07-29 07:13:03 -04:00
|
|
|
#include "../Chunk.h"
|
2018-07-24 17:30:49 -04:00
|
|
|
#include "../Blocks/BroadcastInterface.h"
|
2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cVaporizeFluidSimulator::cVaporizeFluidSimulator(cWorld & a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid) :
|
|
|
|
super(a_World, a_Fluid, a_StationaryFluid)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-17 09:48:38 -04:00
|
|
|
void cVaporizeFluidSimulator::AddBlock(Vector3i a_Block, cChunk * a_Chunk)
|
2013-07-29 07:13:03 -04:00
|
|
|
{
|
2014-10-20 16:55:07 -04:00
|
|
|
if (a_Chunk == nullptr)
|
2013-07-29 07:13:03 -04:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2019-10-16 04:06:34 -04:00
|
|
|
auto relPos = cChunkDef::AbsoluteToRelative(a_Block);
|
|
|
|
auto blockType = a_Chunk->GetBlock(relPos);
|
2013-07-29 07:13:03 -04:00
|
|
|
if (
|
2019-10-16 04:06:34 -04:00
|
|
|
(blockType == m_FluidBlock) ||
|
|
|
|
(blockType == m_StationaryFluidBlock)
|
2013-07-29 07:13:03 -04:00
|
|
|
)
|
|
|
|
{
|
2019-10-16 04:06:34 -04:00
|
|
|
a_Chunk->SetBlock(relPos, E_BLOCK_AIR, 0);
|
2018-07-24 17:30:49 -04:00
|
|
|
World::GetBroadcastInterface(m_World).BroadcastSoundEffect(
|
2017-02-15 00:05:24 -05:00
|
|
|
"block.fire.extinguish",
|
2018-07-24 17:30:49 -04:00
|
|
|
Vector3d(a_Block),
|
2015-05-28 07:29:26 -04:00
|
|
|
1.0f,
|
|
|
|
0.6f
|
|
|
|
);
|
2013-07-29 07:13:03 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void cVaporizeFluidSimulator::Simulate(float a_Dt)
|
|
|
|
{
|
|
|
|
// Nothing needed
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|