mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix out of range enum casts in deSerialize functions (#14090)
This commit is contained in:
parent
0383c44f0d
commit
2ea8d9ca11
15 changed files with 138 additions and 77 deletions
|
@ -1230,8 +1230,13 @@ void Client::handleCommand_HudChange(NetworkPacket* pkt)
|
|||
|
||||
*pkt >> server_id >> stat;
|
||||
|
||||
// Do nothing if stat is not known
|
||||
if (stat >= HudElementStat_END) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Keep in sync with:server.cpp -> SendHUDChange
|
||||
switch ((HudElementStat)stat) {
|
||||
switch (static_cast<HudElementStat>(stat)) {
|
||||
case HUD_STAT_POS:
|
||||
case HUD_STAT_SCALE:
|
||||
case HUD_STAT_ALIGN:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue