mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Fix out of range enum casts in deSerialize functions (#14090)
This commit is contained in:
@@ -2104,7 +2104,7 @@ bool read_hud_change(lua_State *L, HudElementStat &stat, HudElement *elem, void
|
||||
return false;
|
||||
}
|
||||
|
||||
stat = (HudElementStat)statint;
|
||||
stat = static_cast<HudElementStat>(statint);
|
||||
}
|
||||
|
||||
switch (stat) {
|
||||
@@ -2166,6 +2166,9 @@ bool read_hud_change(lua_State *L, HudElementStat &stat, HudElement *elem, void
|
||||
elem->style = luaL_checknumber(L, 4);
|
||||
*value = &elem->style;
|
||||
break;
|
||||
case HudElementStat_END:
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user