1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Implement adding velocity to player from Lua

The intended usecase is knockback, but there's potential for more.
This commit is contained in:
sfan5 2019-07-16 14:00:42 +02:00
parent b19400aa74
commit cf64054390
14 changed files with 105 additions and 2 deletions

View file

@ -1383,6 +1383,17 @@ void Client::handleCommand_CSMRestrictionFlags(NetworkPacket *pkt)
loadMods();
}
void Client::handleCommand_PlayerSpeed(NetworkPacket *pkt)
{
v3f added_vel;
*pkt >> added_vel;
LocalPlayer *player = m_env.getLocalPlayer();
assert(player != NULL);
player->addVelocity(added_vel);
}
/*
* Mod channels
*/