mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Implement adding velocity to player from Lua
The intended usecase is knockback, but there's potential for more.
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user