Skip to content

Commit e5e0fed

Browse files
Add small CS3 text fix
1 parent e90abc8 commit e5e0fed

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

native/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,7 @@ set(SOURCES_CS3_FIXES
968968
sen3/file_fixes/t1020_dat.cpp
969969
sen3/file_fixes/t1230_dat.cpp
970970
sen3/file_fixes/t2000_dat.cpp
971+
sen3/file_fixes/t2030_dat.cpp
971972
sen3/file_fixes/t2070_dat.cpp
972973
sen3/file_fixes/t3000_dat.cpp
973974
sen3/file_fixes/t3030_dat.cpp

native/sen3/file_fixes.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ DECLARE_STANDARD_FIX(t0410_dat)
115115
DECLARE_STANDARD_FIX(t1020_dat)
116116
DECLARE_STANDARD_FIX(t1230_dat)
117117
DECLARE_STANDARD_FIX(t2000_dat)
118+
DECLARE_STANDARD_FIX(t2030_dat)
118119
DECLARE_STANDARD_FIX(t2070_dat)
119120
DECLARE_STANDARD_FIX(t3000_dat)
120121
DECLARE_STANDARD_FIX(t3030_dat)
@@ -305,6 +306,7 @@ static bool CollectAssets(HyoutaUtils::Logger& logger,
305306
TRY_APPLY(t1020_dat, TryApply(callback, packFiles));
306307
TRY_APPLY(t1230_dat, TryApply(callback, packFiles));
307308
TRY_APPLY(t2000_dat, TryApply(callback, packFiles));
309+
TRY_APPLY(t2030_dat, TryApply(callback, packFiles));
308310
TRY_APPLY(t2070_dat, TryApply(callback, packFiles));
309311
TRY_APPLY(t3000_dat, TryApply(callback, packFiles));
310312
TRY_APPLY(t3030_dat, TryApply(callback, packFiles));
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#include <string_view>
2+
#include <vector>
3+
4+
#include "p3a/pack.h"
5+
#include "p3a/structs.h"
6+
#include "sen/file_getter.h"
7+
#include "sen/sen_script_patcher.h"
8+
#include "util/hash/sha1.h"
9+
10+
extern "C" {
11+
__declspec(dllexport) char SenPatcherFix_1_t2030[] =
12+
"Fix text issues in Parm (Dwight Arms & Orbal Factory)";
13+
}
14+
15+
namespace SenLib::Sen3::FileFixes::t2030_dat {
16+
bool TryApply(const SenPatcher::GetCheckedFileCallback& getCheckedFile,
17+
std::vector<SenPatcher::P3APackFile>& result) {
18+
try {
19+
auto file = getCheckedFile(
20+
"data/scripts/scena/dat_en/t2030.dat",
21+
3297,
22+
HyoutaUtils::Hash::SHA1FromHexString("943fca97576e2bd70cc841e866030d32c254f68f"));
23+
if (!file) {
24+
return false;
25+
}
26+
27+
auto& bin = file->Data;
28+
SenScriptPatcher patcher(bin);
29+
30+
// "They used to say bad spirits come\x01out at night, so we never went\x01out after
31+
// sunset."
32+
// double space
33+
// Chapter 1 field trip first day, before returning to camp
34+
patcher.RemovePartialCommand(0x8f0, 0x97, 0x926, 1);
35+
36+
result.emplace_back(std::move(bin), file->Filename, SenPatcher::P3ACompressionType::LZ4);
37+
38+
return true;
39+
} catch (...) {
40+
return false;
41+
}
42+
}
43+
} // namespace SenLib::Sen3::FileFixes::t2030_dat

0 commit comments

Comments
 (0)