Cuberite
A lightweight, fast and extensible game server for Minecraft
|
The pathfinder has 3 types of cells (cPathCell). More...
#include <Path.h>
Public Attributes | |
NIBBLETYPE | m_BlockMeta |
BLOCKTYPE | m_BlockType |
int | m_F |
int | m_G |
int | m_H |
bool | m_IsSolid |
bool | m_IsSpecial |
Vector3i | m_Location |
cPathCell * | m_Parent |
eCellStatus | m_Status |
The pathfinder has 3 types of cells (cPathCell).
1 - empty. m_IsSolid is false, m_IsSpecial is false. Air cells are always traversable by A*. 2 - occupied / solid. m_IsSolid is true, m_IsSpecial is false. Air cells are never traversable by A*. 3 - Special. m_IsSolid is true, m_IsSpecial is true. These cells are special: They may either behave as empty or as occupied / solid, depending on the mob's direction of movement. For instance, an airblock above a fence is a special cell, because when mobs attempt to travel to it by jumping, it acts as a solid. But when mobs fall and land on top of a fence, it acts as air. Special cells include: Doors, ladders, trapdoors, water, gates.
The main function which handles special blocks is SpecialIsSolidFromThisDirection. This function receives a BlockType, a meta, and a direction of travel, then it uses those 3 parameters to decide whether the special block should behave as a solid or as air in this particular direction of travel.
Currently, only fences and water are handled properly. The function always returns "true" (meaning: treat as occuiped/solid) for the rest of the blocks. This will be fixed once the physics engine issues are fixed.
NIBBLETYPE cPathCell::m_BlockMeta |
eCellStatus cPathCell::m_Status |