08-30-2013, 11:52 PM
I would restructure the code this way: If the minecart is not on rails, do the same physics emulation as in cEntity (call super::HandlePhysics() ); otherwise apply rail-based physics (the new code that you wrote).
Because checking if a block is a rail is done in more places, it would make sense to make it into a function:
Because checking if a block is a rail is done in more places, it would make sense to make it into a function:
class cMinecart { ... /// Returns true if the specified blocktype is any kind of a rail static bool IsRailBlockType(BLOCKTYPE a_BlockType); ... }