mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-23 04:45:24 +02:00
Improve luaentity sprite functionality (and add some random stuff)
This commit is contained in:
@@ -1748,6 +1748,11 @@ void LuaEntitySAO::setAcceleration(v3f acceleration)
|
||||
m_acceleration = acceleration;
|
||||
}
|
||||
|
||||
v3f LuaEntitySAO::getAcceleration()
|
||||
{
|
||||
return m_acceleration;
|
||||
}
|
||||
|
||||
void LuaEntitySAO::setTextureMod(const std::string &mod)
|
||||
{
|
||||
std::ostringstream os(std::ios::binary);
|
||||
@@ -1760,6 +1765,22 @@ void LuaEntitySAO::setTextureMod(const std::string &mod)
|
||||
m_messages_out.push_back(aom);
|
||||
}
|
||||
|
||||
void LuaEntitySAO::setSprite(v2s16 p, int num_frames, float framelength,
|
||||
bool select_horiz_by_yawpitch)
|
||||
{
|
||||
std::ostringstream os(std::ios::binary);
|
||||
// command (2 = set sprite)
|
||||
writeU8(os, 2);
|
||||
// parameters
|
||||
writeV2S16(os, p);
|
||||
writeU16(os, num_frames);
|
||||
writeF1000(os, framelength);
|
||||
writeU8(os, select_horiz_by_yawpitch);
|
||||
// create message and add to list
|
||||
ActiveObjectMessage aom(getId(), false, os.str());
|
||||
m_messages_out.push_back(aom);
|
||||
}
|
||||
|
||||
void LuaEntitySAO::sendPosition(bool do_interpolate, bool is_movement_end)
|
||||
{
|
||||
m_last_sent_move_precision = m_base_position.getDistanceFrom(
|
||||
|
Reference in New Issue
Block a user