mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Improved Player Physics
This commit is contained in:
parent
86b906d015
commit
df3c925b3c
10 changed files with 295 additions and 109 deletions
|
@ -1514,6 +1514,26 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if(command == TOCLIENT_MOVEMENT)
|
||||
{
|
||||
std::string datastring((char*)&data[2], datasize-2);
|
||||
std::istringstream is(datastring, std::ios_base::binary);
|
||||
Player *player = m_env.getLocalPlayer();
|
||||
assert(player != NULL);
|
||||
|
||||
player->movement_acceleration_default = readF1000(is) * BS;
|
||||
player->movement_acceleration_air = readF1000(is) * BS;
|
||||
player->movement_acceleration_fast = readF1000(is) * BS;
|
||||
player->movement_speed_walk = readF1000(is) * BS;
|
||||
player->movement_speed_crouch = readF1000(is) * BS;
|
||||
player->movement_speed_fast = readF1000(is) * BS;
|
||||
player->movement_speed_climb = readF1000(is) * BS;
|
||||
player->movement_speed_jump = readF1000(is) * BS;
|
||||
player->movement_liquid_fluidity = readF1000(is) * BS;
|
||||
player->movement_liquid_fluidity_smooth = readF1000(is) * BS;
|
||||
player->movement_liquid_sink = readF1000(is) * BS;
|
||||
player->movement_gravity = readF1000(is) * BS;
|
||||
}
|
||||
else if(command == TOCLIENT_HP)
|
||||
{
|
||||
std::string datastring((char*)&data[2], datasize-2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue