Skip to content

Commit

Permalink
update to 1.24, error with safeptr on stmanager.hpp:154
Browse files Browse the repository at this point in the history
  • Loading branch information
ComputerElite authored and ComputerElite committed Aug 5, 2022
1 parent df5545a commit 65b636b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
16 changes: 8 additions & 8 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@
"author": "EnderdracheLP, ComputerElite, Lauriethefish, Phaze",
"version": "0.6.0",
"packageId": "com.beatgames.beatsaber",
"packageVersion": "1.23.0",
"packageVersion": "1.24.0",
"description": "Allows applications to get information from the game like, currently played song.",
"coverImage": "cover.png",
"dependencies": [
{
"version": "^0.15.12",
"version": "^0.15.18",
"id": "custom-types",
"downloadIfMissing": "https://github.com/sc2ad/Il2CppQuestTypePatching/releases/download/v0.15.12/CustomTypes.qmod"
"downloadIfMissing": "https://github.com/sc2ad/Il2CppQuestTypePatching/releases/download/v0.15.18/CustomTypes.qmod"
},
{
"version": "^0.23.1",
"version": "^0.25.0",
"id": "codegen",
"downloadIfMissing": "https://github.com/sc2ad/BeatSaber-Quest-Codegen/releases/download/v0.23.1/Codegen.qmod"
"downloadIfMissing": "https://github.com/sc2ad/BeatSaber-Quest-Codegen/releases/download/v0.25.0/Codegen.qmod"
},
{
"version": "^0.15.4",
"version": "^0.16.2",
"id": "questui",
"downloadIfMissing": "https://github.com/darknight1050/questui/releases/download/v0.15.4/QuestUI.qmod"
"downloadIfMissing": "https://github.com/darknight1050/questui/releases/download/v0.16.2/QuestUI.qmod"
}
],
"modFiles": [
"libStreamer-Tools.so"
],
"libraryFiles": [
"libbeatsaber-hook_3_8_5.so"
"libbeatsaber-hook_3_10_0.so"
],
"fileCopies": [],
"copyExtensions": []
Expand Down
8 changes: 4 additions & 4 deletions qpm.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": [
{
"id": "beatsaber-hook",
"versionRange": "^3.8.5",
"versionRange": "^3.10.0",
"additionalData": {
"extraFiles": [
"src/inline-hook"
Expand All @@ -29,17 +29,17 @@
},
{
"id": "codegen",
"versionRange": "^0.23.1",
"versionRange": "^0.25.0",
"additionalData": {}
},
{
"id": "questui",
"versionRange": "^0.15.4",
"versionRange": "^0.16.2",
"additionalData": {}
},
{
"id": "custom-types",
"versionRange": "^0.15.12",
"versionRange": "^0.15.18",
"additionalData": {}
},
{
Expand Down
42 changes: 21 additions & 21 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,20 +238,20 @@ MAKE_HOOK_MATCH(RefreshContent, &StandardLevelDetailView::RefreshContent, void,
RefreshContent(self);

// Null Check Level before trying to get any data
if (self->dyn__level()) {
if (self->level) {
stManager->statusLock.lock();
stManager->levelName = std::string(reinterpret_cast<IPreviewBeatmapLevel*>(self->dyn__level())->get_songName());
stManager->levelSubName = std::string(reinterpret_cast<IPreviewBeatmapLevel*>(self->dyn__level())->get_songSubName());
stManager->levelAuthor = std::string(reinterpret_cast<IPreviewBeatmapLevel*>(self->dyn__level())->get_levelAuthorName());
stManager->songAuthor = std::string(reinterpret_cast<IPreviewBeatmapLevel*>(self->dyn__level())->get_songAuthorName());
stManager->id = std::string(reinterpret_cast<IPreviewBeatmapLevel*>(self->dyn__level())->get_levelID());
stManager->bpm = reinterpret_cast<IPreviewBeatmapLevel*>(self->dyn__level())->get_beatsPerMinute();
stManager->levelName = std::string(reinterpret_cast<IPreviewBeatmapLevel*>(self->level)->get_songName());
stManager->levelSubName = std::string(reinterpret_cast<IPreviewBeatmapLevel*>(self->level)->get_songSubName());
stManager->levelAuthor = std::string(reinterpret_cast<IPreviewBeatmapLevel*>(self->level)->get_levelAuthorName());
stManager->songAuthor = std::string(reinterpret_cast<IPreviewBeatmapLevel*>(self->level)->get_songAuthorName());
stManager->id = std::string(reinterpret_cast<IPreviewBeatmapLevel*>(self->level)->get_levelID());
stManager->bpm = reinterpret_cast<IPreviewBeatmapLevel*>(self->level)->get_beatsPerMinute();
// Check if level can be assigned as CustomPreviewBeatmapLevel
bool CustomLevel = (il2cpp_functions::class_is_assignable_from(classof(CustomPreviewBeatmapLevel*), il2cpp_functions::object_get_class(reinterpret_cast<Il2CppObject*>(self->dyn__level()))));
stManager->njs = self->dyn__selectedDifficultyBeatmap()->get_noteJumpMovementSpeed();
stManager->difficulty = self->dyn__selectedDifficultyBeatmap()->get_difficulty().value;
bool CustomLevel = (il2cpp_functions::class_is_assignable_from(classof(CustomPreviewBeatmapLevel*), il2cpp_functions::object_get_class(reinterpret_cast<Il2CppObject*>(self->level))));
stManager->njs = self->selectedDifficultyBeatmap->get_noteJumpMovementSpeed();
stManager->difficulty = self->selectedDifficultyBeatmap->get_difficulty().value;
stManager->coverFetchable = false;
GetCover(reinterpret_cast<GlobalNamespace::PreviewBeatmapLevelSO*>(self->dyn__level()));
GetCover(reinterpret_cast<GlobalNamespace::PreviewBeatmapLevelSO*>(self->level));
stManager->statusLock.unlock();
//GotBeatmapInfo = true;
}
Expand Down Expand Up @@ -297,10 +297,10 @@ MAKE_HOOK_MATCH(GameEnergyUIPanel_HandleGameEnergyDidChange, &GameEnergyUIPanel:

MAKE_HOOK_MATCH(ServerCodeView_RefreshText, &ServerCodeView::RefreshText, void, ServerCodeView* self, bool refreshText) {
ServerCodeView_RefreshText(self, refreshText);
if (self->dyn__serverCode()) {
if (self->serverCode) {
stManager->statusLock.lock();
stManager->mpGameId = to_utf8(csstrtostr(self->dyn__serverCode()));
stManager->mpGameIdShown = self->dyn__codeIsShown();
stManager->mpGameId = to_utf8(csstrtostr(self->serverCode));
stManager->mpGameIdShown = self->codeIsShown;
stManager->statusLock.unlock();
}
}
Expand Down Expand Up @@ -511,14 +511,14 @@ MAKE_HOOK_MATCH(FPSCounter_Update, &FPSCounter::Update, void, FPSCounter* self)

MAKE_HOOK_MATCH(PlayerTransforms_Update, &PlayerTransforms::Update, void, PlayerTransforms* self) {
PlayerTransforms_Update(self);
if (!self->dyn__overrideHeadPos()) {
if (!self->overrideHeadPos) {
stManager->statusLock.lock();
if (self->dyn__headTransform())
stManager->Head = self->dyn__headTransform();
if (self->dyn__rightHandTransform())
stManager->VR_Right = self->dyn__rightHandTransform();
if (self->dyn__leftHandTransform())
stManager->VR_Left = self->dyn__leftHandTransform();
if (self->headTransform)
stManager->Head = self->headTransform;
if (self->rightHandTransform)
stManager->VR_Right = self->rightHandTransform;
if (self->leftHandTransform)
stManager->VR_Left = self->leftHandTransform;
stManager->statusLock.unlock();
}
}
Expand Down

0 comments on commit 65b636b

Please sign in to comment.