Skip to content

Commit

Permalink
fix(skymp5-server): fix form list reversed order (#2158)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pospelove authored Sep 12, 2024
1 parent f53833f commit 291ea9f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion libespm/src/FLST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ FLST::Data FLST::GetData(
}
},
compressedFieldsCache);
std::reverse(result.formIds.begin(), result.formIds.end());
return result;
}

Expand Down
2 changes: 1 addition & 1 deletion unit/EspmTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ TEST_CASE("Loads FormList", "[espm]")
REQUIRE(form.rec->GetType() == "FLST");

auto data = reinterpret_cast<const espm::FLST*>(form.rec)->GetData(cache);
REQUIRE(data.formIds == std::vector<uint32_t>({ 0x3eab9, 0x4e4bb }));
REQUIRE(data.formIds == std::vector<uint32_t>({ 0x4e4bb, 0x3eab9 }));
}

TEST_CASE("Loads refr with primitive", "[espm]")
Expand Down
4 changes: 2 additions & 2 deletions unit/PapyrusFormListTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ TEST_CASE("GetSize/GetAt", "[Papyrus][FormList][espm]")
REQUIRE(PapyrusFormList().GetSize(formlist, {}) == VarValue(2));

VarValue element0 = PapyrusFormList().GetAt(formlist, { VarValue(0) });
REQUIRE(GetRecordPtr(element0).rec->GetId() == 0x3eab9);
REQUIRE(GetRecordPtr(element0).rec->GetId() == 0x4e4bb);

VarValue element1 = PapyrusFormList().GetAt(formlist, { VarValue(1) });
REQUIRE(GetRecordPtr(element1).rec->GetId() == 0x4e4bb);
REQUIRE(GetRecordPtr(element1).rec->GetId() == 0x3eab9);

REQUIRE(PapyrusFormList().GetAt(formlist, { VarValue(-1) }) ==
VarValue::None());
Expand Down

0 comments on commit 291ea9f

Please sign in to comment.