1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix logic inversion for dynamic media (server-side fix) (#15870)

This commit is contained in:
ashtrayoz 2025-03-25 07:35:20 +11:00 committed by GitHub
parent 4ba438a7ec
commit b1363fce8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3750,7 +3750,11 @@ bool Server::dynamicAddMedia(const DynamicMediaArgs &a)
// Push file to existing clients // Push file to existing clients
if (m_env) { if (m_env) {
NetworkPacket pkt(TOCLIENT_MEDIA_PUSH, 0); NetworkPacket pkt(TOCLIENT_MEDIA_PUSH, 0);
pkt << raw_hash << filename << static_cast<bool>(a.ephemeral); pkt << raw_hash << filename;
// NOTE: the meaning of a.ephemeral was accidentally inverted between proto 39 and 40,
// when dynamic_add_media v2 was added. As of 5.12.0 the server sends it correctly again.
// Compatibility code on the client-side was not added.
pkt << static_cast<bool>(!a.ephemeral);
NetworkPacket legacy_pkt = pkt; NetworkPacket legacy_pkt = pkt;