LocalPlayer::LocalPlayer(IGameDef *gamedef):
Player(gamedef),
+ isAttached(false),
+ overridePosition(v3f(0,0,0)),
m_sneak_node(32767,32767,32767),
m_sneak_node_exists(false),
m_old_node_below(32767,32767,32767),
void LocalPlayer::move(f32 dtime, Map &map, f32 pos_max_d,
core::list<CollisionInfo> *collision_info)
{
+ INodeDefManager *nodemgr = m_gamedef->ndef();
+
+ v3f position = getPosition();
+
+ v3f old_speed = m_speed;
+
// Copy parent position if local player is attached
if(isAttached)
{
return;
}
- INodeDefManager *nodemgr = m_gamedef->ndef();
-
- v3f position = getPosition();
-
- v3f old_speed = m_speed;
-
// Skip collision detection if a special movement mode is used
bool fly_allowed = m_gamedef->checkLocalPrivilege("fly");
bool free_move = fly_allowed && g_settings->getBool("free_move");
setPitch(control.pitch);
setYaw(control.yaw);
-
+
+ // Nullify speed and don't run positioning code if the player is attached
+ if(isAttached)
+ {
+ setSpeed(v3f(0,0,0));
+ return;
+ }
+
v3f move_direction = v3f(0,0,1);
move_direction.rotateXZBy(getYaw());
os<<serializeString(liquid_alternative_flowing);
os<<serializeString(liquid_alternative_source);
writeU8(os, liquid_viscosity);
- writeU8(os, liquid_renewable);
writeU8(os, light_source);
writeU32(os, damage_per_second);
node_box.serialize(os);
liquid_alternative_flowing = deSerializeString(is);
liquid_alternative_source = deSerializeString(is);
liquid_viscosity = readU8(is);
- liquid_renewable = readU8(is);
light_source = readU8(is);
damage_per_second = readU32(is);
node_box.deSerialize(is);