Moving physics from Tick to HandlePhysics
#6
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:
class cMinecart
{
  ...
  /// Returns true if the specified blocktype is any kind of a rail
  static bool IsRailBlockType(BLOCKTYPE a_BlockType);
  ...
}
Reply
Thanks given by:


Messages In This Thread
RE: Moving physics from Tick to HandlePhysics - by xoft - 08-30-2013, 11:52 PM



Users browsing this thread: 9 Guest(s)