Skip to content

Commit

Permalink
Closes #180 Fix bugged v1.02 dialog actions (#181)
Browse files Browse the repository at this point in the history
* Closes #180 Fix buggy v1.02 dialog actions

v1.02 of BAK purported to fix a number of issues with v1.01,
unfortunately the patching process appears to have broken a number of
dialog actions, including many audio actions, as well as a few game
critical actions like the Fadamor's well, Prank's stone, and many
others.

I've added a list of dialog action replacements that come from v1.01 and
will be applied to the dialog actions of snippets as they are built.
  • Loading branch information
xavieran authored Feb 29, 2024
1 parent b178b88 commit 6048af3
Show file tree
Hide file tree
Showing 5 changed files with 475 additions and 0 deletions.
1 change: 1 addition & 0 deletions bak/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ add_library(bak
coordinates.hpp coordinates.cpp
dataTags.hpp
dialog.hpp dialog.cpp
dialogReplacements.hpp dialogReplacements.cpp
dialogAction.hpp dialogAction.cpp
dialogChoice.hpp dialogChoice.cpp
dialogSources.hpp
Expand Down
1 change: 1 addition & 0 deletions bak/constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ enum class Actor
namespace Times {
static constexpr auto HalfHour = Time{0x384};
static constexpr auto OneHour = Time{0x708};
static constexpr auto ThreeHours = Time{0x1518};
static constexpr auto EightHours = Time{0x3840};
static constexpr auto TwelveHours = Time{0x5460};
static constexpr auto ThirteenHours = Time{0x5b68};
Expand Down
5 changes: 5 additions & 0 deletions bak/dialog.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "bak/dialog.hpp"

#include "bak/constants.hpp"
#include "bak/dialogReplacements.hpp"

#include "com/assert.hpp"

namespace BAK {
Expand Down Expand Up @@ -347,6 +350,8 @@ DialogSnippet::DialogSnippet(FileBuffer& fb, std::uint8_t dialogFile)
} break;
}
}

Replacements::ReplaceActions(OffsetTarget{dialogFile, fileOffset}, mActions);

if (length > 0)
mText = fb.GetString(length);
Expand Down
Loading

0 comments on commit 6048af3

Please sign in to comment.