mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
fine-tuning of map generator and server and stuff.
This commit is contained in:
@@ -46,6 +46,20 @@ Player::~Player()
|
||||
// Y direction is ignored
|
||||
void Player::accelerate(v3f target_speed, f32 max_increase)
|
||||
{
|
||||
v3f d_wanted = target_speed - m_speed;
|
||||
d_wanted.Y = 0;
|
||||
f32 dl_wanted = d_wanted.getLength();
|
||||
f32 dl = dl_wanted;
|
||||
if(dl > max_increase)
|
||||
dl = max_increase;
|
||||
|
||||
v3f d = d_wanted.normalize() * dl;
|
||||
|
||||
m_speed.X += d.X;
|
||||
m_speed.Z += d.Z;
|
||||
//m_speed += d;
|
||||
|
||||
#if 0 // old code
|
||||
if(m_speed.X < target_speed.X - max_increase)
|
||||
m_speed.X += max_increase;
|
||||
else if(m_speed.X > target_speed.X + max_increase)
|
||||
@@ -63,6 +77,7 @@ void Player::accelerate(v3f target_speed, f32 max_increase)
|
||||
m_speed.Z = target_speed.Z;
|
||||
else if(m_speed.Z > target_speed.Z)
|
||||
m_speed.Z = target_speed.Z;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -209,7 +224,7 @@ void LocalPlayer::move(f32 dtime, Map &map)
|
||||
position += m_speed * dtime;
|
||||
|
||||
// Skip collision detection if player is non-local
|
||||
if(isLocal() == false)
|
||||
if(isLocal() == false || HAXMODE)
|
||||
{
|
||||
setPosition(position);
|
||||
return;
|
||||
@@ -286,10 +301,6 @@ void LocalPlayer::move(f32 dtime, Map &map)
|
||||
{
|
||||
// Doing nothing here will block the player from
|
||||
// walking over map borders
|
||||
|
||||
// Go over borders in debug mode
|
||||
if(HAXMODE)
|
||||
continue;
|
||||
}
|
||||
|
||||
core::aabbox3d<f32> nodebox = Map::getNodeBox(
|
||||
|
Reference in New Issue
Block a user