Skip to content

Commit

Permalink
fix(CutsceneLibrary): broken load/save
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed Nov 2, 2024
1 parent e1f1cb5 commit 243d31c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/CutsceneLibrary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ ZkCutsceneLibrary* ZkCutsceneLibrary_load(ZkRead* buf) {

try {
auto ar = zenkit::ReadArchive::from(buf);
auto obj = new ZkCutsceneLibrary(new zenkit::CutsceneLibrary());
(*obj)->load(*ar, zenkit::GameVersion::GOTHIC_1);
return obj;
auto obj = ar->read_object<zenkit::CutsceneLibrary>(zenkit::GameVersion::GOTHIC_1);
return ZKC_WRAP_NEW(obj);
} catch (std::exception const& exc) {
ZKC_LOG_ERROR("ZkCutsceneLibrary_load() failed: %s", exc.what());
return nullptr;
Expand Down Expand Up @@ -59,6 +58,7 @@ void ZkCutsceneLibrary_save(ZkCutsceneLibrary* slf, ZkWrite* buf, ZkArchiveForma
try {
auto ar = zenkit::WriteArchive::to(buf, static_cast<zenkit::ArchiveFormat>(fmt));
SLF->save(*ar, zenkit::GameVersion::GOTHIC_1);
ar->write_header();
} catch (std::exception const& exc) {
ZKC_LOG_ERROR("ZkCutsceneLibrary_save() failed: %s", exc.what());
}
Expand Down

0 comments on commit 243d31c

Please sign in to comment.