1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-08 09:37:53 +00:00

Fix argument validation in Lua command cell:getAll

This commit is contained in:
Petr Mikheev 2023-07-03 02:43:52 +02:00
parent 89c18d85de
commit e96864a79c

View File

@ -88,19 +88,15 @@ namespace MWLua
return true;
};
bool ok = false;
sol::optional<uint32_t> typeId = sol::nullopt;
if (type.has_value())
typeId = ids[*type];
bool ok = true;
if (!type.has_value())
cell.mStore->forEach(std::move(visitor));
else if (ids[*type] == sol::nil)
ok = false;
else
{
ok = true;
cell.mStore->forEach(std::move(visitor));
}
if (typeId.has_value())
{
ok = true;
switch (*typeId)
uint32_t typeId = ids[*type];
switch (typeId)
{
case ESM::REC_INTERNAL_PLAYER:
{