1
0

Add HOOK_BLOCK_SPREAD

This commit is contained in:
Howaner
2014-03-16 14:38:41 +01:00
parent 7089c5e267
commit c4a8336e84
6 changed files with 57 additions and 3 deletions

View File

@@ -6,6 +6,8 @@
#include "../BlockID.h"
#include "../Defines.h"
#include "../Chunk.h"
#include "Root.h"
#include "PluginManager.h"
@@ -315,9 +317,15 @@ void cFireSimulator::TrySpreadFire(cChunk * a_Chunk, int a_RelX, int a_RelY, int
*/
if (CanStartFireInBlock(a_Chunk, x, y, z))
{
FLOG("FS: Starting new fire at {%d, %d, %d}.",
x + a_Chunk->GetPosX() * cChunkDef::Width, y, z + a_Chunk->GetPosZ() * cChunkDef::Width
);
int a_PosX = x + a_Chunk->GetPosX() * cChunkDef::Width;
int a_PosZ = z + a_Chunk->GetPosZ() * cChunkDef::Width;
if (cRoot::Get()->GetPluginManager()->CallHookBlockSpread(&m_World, a_PosX, y, a_PosZ))
{
return;
}
FLOG("FS: Starting new fire at {%d, %d, %d}.", a_PosX, y, a_PosZ);
a_Chunk->UnboundedRelSetBlock(x, y, z, E_BLOCK_FIRE, 0);
}
} // for y