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:
parent
b19400aa74
commit
cf64054390
14 changed files with 105 additions and 2 deletions
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue