aboutsummaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorWuzzy <Wuzzy@disroot.org>2022-07-02 18:57:48 +0000
committerGitHub <noreply@github.com>2022-07-02 19:57:48 +0100
commit142928e944db089cccce6c0ea32a89b32300b3d1 (patch)
tree666fa8664a4a0a4d2d365d24ff61448e257759cc /src/network
parentb095dc4f2bf2a1ace010dfae0ead69654b0ca3ac (diff)
downloadminetest-142928e944db089cccce6c0ea32a89b32300b3d1.tar.gz
minetest-142928e944db089cccce6c0ea32a89b32300b3d1.tar.bz2
minetest-142928e944db089cccce6c0ea32a89b32300b3d1.zip
Allow to set maximum star opacity at daytime (#11663)
Diffstat (limited to 'src/network')
-rw-r--r--src/network/clientpackethandler.cpp5
-rw-r--r--src/network/networkprotocol.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp
index 764f6569f..fba0fe72d 100644
--- a/src/network/clientpackethandler.cpp
+++ b/src/network/clientpackethandler.cpp
@@ -1340,10 +1340,13 @@ void Client::handleCommand_HudSetMoon(NetworkPacket *pkt)
void Client::handleCommand_HudSetStars(NetworkPacket *pkt)
{
- StarParams stars;
+ StarParams stars = SkyboxDefaults::getStarDefaults();
*pkt >> stars.visible >> stars.count
>> stars.starcolor >> stars.scale;
+ try {
+ *pkt >> stars.day_opacity;
+ } catch (PacketError &e) {};
ClientEvent *event = new ClientEvent();
event->type = CE_SET_STARS;
diff --git a/src/network/networkprotocol.h b/src/network/networkprotocol.h
index 3923cb858..7c5b2e3fe 100644
--- a/src/network/networkprotocol.h
+++ b/src/network/networkprotocol.h
@@ -735,6 +735,7 @@ enum ToClientCommand
u32 count
u8[4] starcolor (ARGB)
f32 scale
+ f32 day_opacity
*/
TOCLIENT_SRP_BYTES_S_B = 0x60,