// Smooth the movement when walking up stairs
v3f old_player_position = m_playernode->getPosition();
v3f player_position = player->getPosition();
+ if (player->isAttached && player->parent)
+ player_position = player->parent->getPosition();
//if(player->touching_ground && player_position.Y > old_player_position.Y)
if(player->touching_ground &&
player_position.Y > old_player_position.Y)
{
LocalPlayer *player = m_env->getLocalPlayer();
player->overridePosition = getParent()->getPosition();
+ m_env->getLocalPlayer()->parent = getParent();
}
}
else
LocalPlayer::LocalPlayer(IGameDef *gamedef):
Player(gamedef),
+ parent(0),
isAttached(false),
overridePosition(v3f(0,0,0)),
last_position(v3f(0,0,0)),
class ClientEnvironment;
+class ClientActiveObject;
+
class LocalPlayer : public Player
{
public:
{
return true;
}
+
+ ClientActiveObject *parent;
bool isAttached;