mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-06 17:41:04 +00:00
Value copy / allocation optimizations mostly in server, SAO and serialize code
This commit is contained in:
parent
2fd5f38c45
commit
471e567657
16 changed files with 52 additions and 64 deletions
|
@ -223,8 +223,7 @@ void PlayerSAO::step(float dtime, bool send_recommended)
|
|||
m_properties_sent = true;
|
||||
std::string str = getPropertyPacket();
|
||||
// create message and add to list
|
||||
ActiveObjectMessage aom(getId(), true, str);
|
||||
m_messages_out.push(aom);
|
||||
m_messages_out.emplace(getId(), true, str);
|
||||
m_env->getScriptIface()->player_event(this, "properties_changed");
|
||||
}
|
||||
|
||||
|
@ -324,10 +323,8 @@ void PlayerSAO::step(float dtime, bool send_recommended)
|
|||
|
||||
if (!m_attachment_sent) {
|
||||
m_attachment_sent = true;
|
||||
std::string str = generateUpdateAttachmentCommand();
|
||||
// create message and add to list
|
||||
ActiveObjectMessage aom(getId(), true, str);
|
||||
m_messages_out.push(aom);
|
||||
m_messages_out.emplace(getId(), true, generateUpdateAttachmentCommand());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue