From c21118bc0682b31cc5b9e343376c8089015aafe7 Mon Sep 17 00:00:00 2001
From: WeirdYunus <166413432+WeirdYunus@users.noreply.github.com>
Date: Wed, 4 Sep 2024 13:58:10 +0300
Subject: [PATCH 1/9] Update tr.json
---
Code/skyrim_ui/src/assets/i18n/tr.json | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Code/skyrim_ui/src/assets/i18n/tr.json b/Code/skyrim_ui/src/assets/i18n/tr.json
index fa45ee874..10ea14342 100644
--- a/Code/skyrim_ui/src/assets/i18n/tr.json
+++ b/Code/skyrim_ui/src/assets/i18n/tr.json
@@ -4,6 +4,8 @@
"SEND": "Gönder",
"MESSAGE": "Mesaj",
"MESSAGE_TOO_LONG": "{{chatMessageLengthLimit}} harften daha uzun bir mesaj gönderemezsin."
+ "SET_TIME_ARGUMENT_COUNT": "Yanlış argümanlar, kullanımı: /settime SS DD, örnek: /settime 15 32.",
+ "SET_TIME_INVALID_ARGUMENTS": "Saat 0 ile 23 ve dakika 0 ile 59 arasında olmalıdır."
},
"CONNECT": {
"INFO": {
@@ -149,6 +151,7 @@
"COMMANDS": {
"AVAILABLE_COMMANDS": "Mevcut chat komutları: {{cmds}}",
"COMMAND_NOT_FOUND": "'{{cmd}}' geçerli bir komut değil."
+ "NOT_ADMIN": "Bu komutu kullanmak için Admin olmanız gerek."
},
"GROUP": {
"LEVEL_UP": "{{name}} {{level}} oldu.",
@@ -166,6 +169,8 @@
"WRONG_PASSWORD": "Girdiğiniz parola yanlış.",
"NO_REASON": "Sunucu sebep vermeden bağlantıyı reddetti.",
"SERVER_FULL": "Sunucu Dolu."
+ "BAD_UGRIDSTOLOAD": "Görünüşe göre Skyrim.ini dosyanız 'uGridsToLoad' için varsayılan değerde değil. BU ÇOK KÖTÜ BİR FİKİR, ve muhtemelen modu bozar. Lütfen bu ayarı varsayılana çekiniz (5), ya da Skyrim.ini dosyasını silip Skyrim'ı vanilla olarak başlatıp yenisini oluşturun. 'uExterior Cell Buffer' ve 'uInterior Cell Buffer' ayarları varsayılan olarak kalmalı. Bunu nasıl yapacağınızı bilmiyorsanız, Lütfen wiki sayfamıza bakın veya Discord sunucusu/Reddit üzerinden yardım isteyiniz.",
+ "NON_DEFAULT_INSTALL": "Görünüşe göre yüklemeniz tamamen vanilla değil, örneğin, Creation Club içeriği (Anniversary Güncellemesi ya da diğer türlüsü) ya da diğer modlar.\nModlar ile oynamanızı ÖNERMİYORUZ.\nBu modları silip deaktif etmenizi öneriyoruz (talimatlar wiki sayfasında bulunabilir).\n\nEn iyi deneyim için, bu mod listesine sahip olmanız gerek:\nSkyrim.esm\nUpdate.esm\nDawnguard.esm\nHearthFires.esm\nDragonborn.esm\n_ResourcePack.esl\nSkyrimTogether.esp"
}
},
"PLAYER_LIST": {
From 1fe2e2014195b656cb36d94e5f8db23ff9d8e4a3 Mon Sep 17 00:00:00 2001
From: Anthony
Date: Tue, 26 Nov 2024 05:50:04 -0500
Subject: [PATCH 2/9] fix: force UI state when tabbing in with UI visible
(#745)
---
Code/client/Services/Generic/InputService.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/Code/client/Services/Generic/InputService.cpp b/Code/client/Services/Generic/InputService.cpp
index 662c61f98..558ead849 100644
--- a/Code/client/Services/Generic/InputService.cpp
+++ b/Code/client/Services/Generic/InputService.cpp
@@ -400,6 +400,14 @@ LRESULT CALLBACK InputService::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPAR
}
ProcessKeyboard(virtualKey, scancode, KEYEVENT_CHAR, false, false);
}
+ // If the player tabs out/in with UI visible, this WndProc doesn't run during mouse or keyboard events.
+ // When player tabs in, force the UI state
+ else if (uMsg == WM_SETFOCUS && s_pOverlay->GetActive())
+ {
+ TiltedPhoques::DInputHook::Get().SetEnabled(true);
+ s_pOverlay->SetActive(true);
+ pRenderer->SetCursorVisible(true);
+ }
else if (uMsg == WM_INPUTLANGCHANGE)
{
s_currentACP = GetRealACP();
From 7399596217c15b67a1d8e779d0534c09110fbb88 Mon Sep 17 00:00:00 2001
From: Vincent Hengel
Date: Tue, 26 Nov 2024 12:38:50 +0100
Subject: [PATCH 3/9] Add a nix flake for people on nixos
This is also very nice since it always supplies a known working version of the deps (xmake)
---
flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
flake.nix | 44 +++++++++++++++++++++++++++++++++++++++
2 files changed, 105 insertions(+)
create mode 100644 flake.lock
create mode 100644 flake.nix
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 000000000..5ba6ab84e
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,61 @@
+{
+ "nodes": {
+ "flake-utils": {
+ "inputs": {
+ "systems": "systems"
+ },
+ "locked": {
+ "lastModified": 1731533236,
+ "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1732014248,
+ "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "nixpkgs": "nixpkgs"
+ }
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 000000000..3abe0654e
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,44 @@
+{
+ description = "Tilted C++ development environment";
+
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
+ flake-utils.url = "github:numtide/flake-utils";
+ };
+
+ outputs = { self, nixpkgs, flake-utils }:
+ flake-utils.lib.eachDefaultSystem (system:
+ let
+ pkgs = import nixpkgs {
+ inherit system;
+ };
+ in
+ {
+ devShells.default = pkgs.mkShell {
+ buildInputs = with pkgs; [
+ gcc14
+ gdb
+ libclang
+ cmake
+ xmake
+ gnumake
+ ];
+
+ shellHook = ''
+ # Unset environment variables, required for xmake to find
+ # the linker/compiler that we provide here
+ unset CC
+ unset CXX
+ unset LD
+ unset AR
+ unset AS
+ unset RANLIB
+ unset STRIP
+ unset CFLAGS
+ unset CXXFLAGS
+ unset LDFLAGS
+ echo "C++ development environment loaded"
+ '';
+ };
+ });
+}
From b340d1bff3387016c8038164eceb1db6519153f3 Mon Sep 17 00:00:00 2001
From: Vincent Hengel
Date: Tue, 26 Nov 2024 12:39:28 +0100
Subject: [PATCH 4/9] Hackfix: Disable quit handler for now
---
Code/server_runner/main.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/Code/server_runner/main.cpp b/Code/server_runner/main.cpp
index e18551e6b..5916f71f0 100644
--- a/Code/server_runner/main.cpp
+++ b/Code/server_runner/main.cpp
@@ -223,9 +223,10 @@ int main(int argc, char** argv)
}
*/
- ScopedCrashHandler _(true, true);
+ //ScopedCrashHandler _(true, true);
- RegisterQuitHandler();
+ // Note(Vince): This started crashing on 1.7+ lets disable it for now.
+ // RegisterQuitHandler();
// Keep stack free.
const auto cpRunner{std::make_unique(argc, argv)};
@@ -233,6 +234,7 @@ int main(int argc, char** argv)
{
cpRunner->StartTerminalIO();
}
+
cpRunner->RunGSThread();
return 0;
From fd17d63ebc22a9b4ad1242c4e46fdb3642f0bed4 Mon Sep 17 00:00:00 2001
From: Daniil Zakharov
Date: Sat, 30 Nov 2024 01:59:10 +0300
Subject: [PATCH 5/9] Add conditional step to checkout master on tag push
---
.github/workflows/windows-playable-build.yml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/.github/workflows/windows-playable-build.yml b/.github/workflows/windows-playable-build.yml
index 18f6a42e4..4753774c7 100644
--- a/.github/workflows/windows-playable-build.yml
+++ b/.github/workflows/windows-playable-build.yml
@@ -32,6 +32,11 @@ jobs:
git submodule sync --recursive
git submodule update --init --force --recursive --depth=1
+ - name: Checkout master on tag push
+ if: github.ref_type == 'tag'
+ # Checkout only if the tag was pushed to master
+ run: (git rev-parse HEAD) -eq (git rev-parse origin/master) -and (git checkout master)
+
- name: Cache xmake dependencies
uses: actions/cache@v4
with:
From 07c3765f5ff6368a92eacd2f6bc8333761dc93ae Mon Sep 17 00:00:00 2001
From: WeirdYunus <166413432+WeirdYunus@users.noreply.github.com>
Date: Sat, 30 Nov 2024 11:36:50 +0300
Subject: [PATCH 6/9] Update tr.json
---
Code/skyrim_ui/src/assets/i18n/tr.json | 1 +
1 file changed, 1 insertion(+)
diff --git a/Code/skyrim_ui/src/assets/i18n/tr.json b/Code/skyrim_ui/src/assets/i18n/tr.json
index 10ea14342..87d9e0ba6 100644
--- a/Code/skyrim_ui/src/assets/i18n/tr.json
+++ b/Code/skyrim_ui/src/assets/i18n/tr.json
@@ -81,6 +81,7 @@
"ROOT": {
"CONNECT": "Bağlan",
"DISCONNECT": "Bağlantıyı Kopar",
+ "REVEAL_PLAYERS": "Oyuncuları Göster",
"RECONNECT": "Geri Bağlan",
"PLAYER_MANAGER": "Oyuncu Yöneticisi",
"SETTINGS": "Ayarlar",
From bf1b9a02a5c6d0ce89255af7615d9205fbf740b5 Mon Sep 17 00:00:00 2001
From: absol89
Date: Sat, 30 Nov 2024 21:48:51 +0100
Subject: [PATCH 7/9] Default PetFramework scripts to be edited
---
.../source/PetFramework_ParentQuestScript.psc | 100 ++++++++++++++
.../scripts/source/PetFramework_PetQuest.psc | 128 ++++++++++++++++++
2 files changed, 228 insertions(+)
create mode 100644 GameFiles/Skyrim/scripts/source/PetFramework_ParentQuestScript.psc
create mode 100644 GameFiles/Skyrim/scripts/source/PetFramework_PetQuest.psc
diff --git a/GameFiles/Skyrim/scripts/source/PetFramework_ParentQuestScript.psc b/GameFiles/Skyrim/scripts/source/PetFramework_ParentQuestScript.psc
new file mode 100644
index 000000000..2b70e8af5
--- /dev/null
+++ b/GameFiles/Skyrim/scripts/source/PetFramework_ParentQuestScript.psc
@@ -0,0 +1,100 @@
+Scriptname PetFramework_ParentQuestScript extends Quest
+{Get/Set functions for pet count and limit checks. All other shared controls are in PetFramework_PetScript.}
+;rvogel 9/2017
+
+GlobalVariable Property PetFramework_MaxPets Auto ;Max number of pets who can follow at once, default is 2
+
+;RefAliases to fill from DLC at runtime
+
+ReferenceAlias Property DLC2SeverinManorEnableMarker Auto
+ReferenceAlias Property HomeMarkerDLC2SeverinManor Auto
+
+ReferenceAlias Property BYOH01DoorLakeviewManor Auto
+ReferenceAlias Property BYOH02DoorWindstadManor Auto
+ReferenceAlias Property BYOH03DoorHeljarchenHall Auto
+
+ReferenceAlias Property HomeMarkerLakeviewManor Auto
+ReferenceAlias Property HomeMarkerWindstadManor Auto
+ReferenceAlias Property HomeMarkerHeljarchenHall Auto
+
+Faction Property PetFramework_PetFaction Auto
+Faction Property PlayerFaction Auto
+
+Faction Property CWSonsFaction Auto
+Faction Property CWImperialFaction Auto
+
+Int Property CurrentPetCount = 0 Auto Hidden ;Current count of pets, this is manipulated by pet ESPs/ESLs using the functions below
+
+Event OnInit()
+ debug.trace("Setting pet and player relationship to ally")
+ PetFramework_PetFaction.SetAlly(PlayerFaction)
+
+ ;Prevent CW actors from becoming hostile to pets
+ PetFramework_PetFaction.SetAlly(CWSonsFaction)
+ PetFramework_PetFaction.SetAlly(CWImperialFaction)
+EndEvent
+
+Int Function GetCurrentPetCount()
+{Called by 'child' pet ESPs/ESLs to get current count and limit}
+ Return CurrentPetCount
+EndFunction
+
+Int Function GetMaxPets()
+{Called by 'child' pet ESPs/ESLs to get max pets}
+ Return PetFramework_MaxPets.GetValue() as Int
+EndFunction
+
+Function IncrementPetCount()
+{Called by 'child' pet ESPs/ESLs to update active pet count}
+ CurrentPetCount += 1
+EndFunction
+
+Function DecrementPetCount()
+{Called by 'child' pet ESPs/ESLs to update active pet count}
+ If(CurrentPetCount > 0)
+ CurrentPetCount -= 1
+ EndIf
+EndFunction
+
+Bool Function HasMaxPets()
+{Called to check if the player has the maximum pets allowed}
+
+ If(GetCurrentPetCount() == GetMaxPets())
+ Return True
+ Else
+ Return False
+ EndIf
+
+EndFunction
+
+
+Function FillRefAliasesFromDLC()
+{Called from first stage of quest to fill aliases from DLC that are unreachable by Update.esm}
+
+ ;Dragonborn Refs (Marker and Chest used to check ownership)
+ ObjectReference DLC2SeverinManorEnableRef = (Game.GetFormFromFile(0x040396D0, "dragonborn.esm") as ObjectReference)
+ ObjectReference DLC2SeverinManorMarkerRef = (Game.GetFormFromFile(0x0403BD35, "dragonborn.esm") as ObjectReference)
+
+ ;Hearthfire Refs (Doors)
+ ObjectReference DoorLakeviewManorRef = (Game.GetFormFromFile(0x03003221, "hearthfires.esm") as ObjectReference)
+ ObjectReference DoorWindstadManorRef = (Game.GetFormFromFile(0x0300B852, "hearthfires.esm") as ObjectReference)
+ ObjectReference DoorHeljarchenHallRef = (Game.GetFormFromFile(0x03010DDF, "hearthfires.esm") as ObjectReference)
+
+ ;Hearthfire Refs (Markers)
+ ObjectReference MarkerLakeviewManorRef = (Game.GetFormFromFile(0x0300309B, "hearthfires.esm") as ObjectReference)
+ ObjectReference MarkerWindstadManorRef = (Game.GetFormFromFile(0x0301205C, "hearthfires.esm") as ObjectReference)
+ ObjectReference MarkerHeljarchenHallRef = (Game.GetFormFromFile(0x03016E05, "hearthfires.esm") as ObjectReference)
+
+ ;Fill the refs
+ DLC2SeverinManorEnableMarker.ForceRefTo(DLC2SeverinManorEnableRef)
+ HomeMarkerDLC2SeverinManor.ForceRefTo(DLC2SeverinManorMarkerRef)
+
+ BYOH01DoorLakeviewManor.ForceRefTo(DoorLakeviewManorRef)
+ BYOH02DoorWindstadManor.ForceRefTo(DoorWindstadManorRef)
+ BYOH03DoorHeljarchenHall.ForceRefTo(DoorHeljarchenHallRef)
+
+ HomeMarkerLakeviewManor.ForceRefTo(MarkerLakeviewManorRef)
+ HomeMarkerWindstadManor.ForceRefTo(MarkerWindstadManorRef)
+ HomeMarkerHeljarchenHall.ForceRefTo(MarkerHeljarchenHallRef)
+
+EndFunction
diff --git a/GameFiles/Skyrim/scripts/source/PetFramework_PetQuest.psc b/GameFiles/Skyrim/scripts/source/PetFramework_PetQuest.psc
new file mode 100644
index 000000000..20a345452
--- /dev/null
+++ b/GameFiles/Skyrim/scripts/source/PetFramework_PetQuest.psc
@@ -0,0 +1,128 @@
+Scriptname PetFramework_PetQuest extends Quest Conditional
+{Manages the pet's home location, commands, etc. Some functions are called from the pet actor script.}
+
+PetFramework_ParentQuestScript Property PetFramework_ParentQuest Auto
+Message Property PetFramework_PetDismissMessage Auto
+Message Property PetFramework_PetMaxReachedMessage Auto
+Faction Property PetFramework_PetFollowingFaction Auto
+Faction Property PlayerFaction Auto
+Faction Property PetFramework_PetFaction Auto
+ReferenceAlias Property PetHomeMarker Auto
+ReferenceAlias Property PetRefAlias Auto
+ReferenceAlias Property PetDynamicHomeMarker Auto
+Bool Property MovingTogglePackageOn = False Auto Conditional Hidden ;Hearthfire adoption/move trick - turn on a temporary package
+
+Function MakePetAvailableToPlayer()
+{Called when the quest meets the criteria for the pet to be available, i.e. purchase, rescue, whatever scenario. Without this the pet cannot be talked to or recruited.}
+ PetRefAlias.GetActorReference().SetFactionRank(PetFramework_PetFaction, 1)
+ ;PetRefAlias.GetActorReference().AddToFaction(PlayerFaction)
+EndFunction
+
+Function MakePetUnavailableToPlayer()
+{If for some reason we want to make the pet unavailable to player, i.e. sell it someone else, etc. this function will do that}
+ PetRefAlias.GetActorReference().SetFactionRank(PetFramework_PetFaction, 0)
+ ;PetRefAlias.GetActorReference().RemoveFromFaction(PlayerFaction)
+EndFunction
+
+Function FollowPlayer(Bool snapIntoInteraction = False)
+{Called when the player recruits the pet via dialogue.}
+
+ If(PetFramework_ParentQuest.HasMaxPets())
+ PetFramework_PetMaxReachedMessage.Show()
+ Else
+
+ debug.trace("Pet Framework: " + PetRefAlias.GetActorReference() + " setting to following player")
+ debug.trace("Pet Framework: " + PetRefAlias.GetActorReference() + " PetFollowingFactionRank: " + PetRefAlias.GetActorReference().GetFactionRank(PetFramework_PetFollowingFaction))
+
+ ;If the pet was waiting for the player, clear the actor value (no need to check just run it)
+ WaitForPlayer(False)
+
+ ;Set the rank to 1, which will enable dialogue commands, etc. (used by shared pet framework)
+ PetRefAlias.GetActorReference().SetFactionRank(PetFramework_PetFollowingFaction, 1)
+
+ debug.trace("Pet Framework: " + PetRefAlias.GetActorReference() + " PetFollowingFactionRank: " + PetRefAlias.GetActorReference().GetFactionRank(PetFramework_PetFollowingFaction))
+
+ ;Some animals have very long idles they get 'stuck' which feels like recruiting them didn't do anything
+ If(snapIntoInteraction)
+ PetRefAlias.GetReference().Disable()
+ PetRefAlias.GetReference().Enable()
+ EndIf
+
+ PetFramework_ParentQuest.IncrementPetCount()
+ debug.trace("Pet Count: " + PetFramework_ParentQuest.GetCurrentPetCount())
+
+ ;Re-evaluate the package stack based on our new conditions
+ PetRefAlias.GetActorReference().EvaluatePackage()
+
+ EndIf
+
+EndFunction
+
+Function WaitForPlayer(Bool doWait = True)
+{True/False: Pet will wait for the player or continue to follow.}
+
+ DEBUG.TRACE("WaitForPlayer called with value: " + doWait)
+
+ If(doWait == True)
+ debug.trace("PetFramework Setting pet to wait for player")
+ PetRefAlias.GetActorReference().SetAV("WaitingForPlayer", 1)
+ Else
+ debug.trace("PetFramework Setting pet to stop waiting for player")
+ PetRefAlias.GetActorReference().SetAV("WaitingForPlayer", 0)
+ EndIf
+
+ ;Re-evaluate the package stack based on our new conditions
+ PetRefAlias.GetActorReference().EvaluatePackage()
+
+EndFunction
+
+Function SetHomeToCurrentLocation()
+{Makes the "Home" of the pet right where they stand, so they will dismiss and sandbox the area (house mods, camping, etc.)}
+
+ ;Move the xmarker to where the pet is standing
+ PetDynamicHomeMarker.GetReference().MoveTo(PetRefAlias.GetReference())
+ PetDynamicHomeMarker.GetReference().SetAngle(0,0,0)
+
+ ;Set the home idle marker to the dynamic marker
+ SetNewHome(PetDynamicHomeMarker, True)
+
+EndFunction
+
+Function SetNewHome(ReferenceAlias newLocation, Bool dismiss = True, Bool doWarp = False)
+
+ debug.trace("Set New Home called from actor proxy")
+
+ ;Clear the waiting flag
+ WaitForPlayer(False)
+
+ ;Turn on the temporary package while we change the ref alias data for their idle package - trick from Hearthfire adoption
+ MovingTogglePackageOn = True ;"Hold"AI package looks at this quest var
+ PetRefAlias.GetActorReference().EvaluatePackage()
+
+ ;Set the ref alias to be the pet's new home
+ PetHomeMarker.ForceRefTo(newLocation.GetReference())
+
+ ;Remove them from current following faction so they actually go to their new home
+ If(dismiss)
+ PetRefAlias.GetActorReference().SetFactionRank(PetFramework_PetFollowingFaction, 0)
+ EndIf
+
+ Utility.Wait(0.1)
+
+ MovingTogglePackageOn = False
+ PetRefAlias.GetActorReference().EvaluatePackage()
+
+ If(doWarp)
+ Utility.Wait(0.01)
+ PetRefAlias.GetReference().MoveTo(newLocation.GetReference(), 0,0,0,False)
+ EndIf
+
+ PetFramework_PetDismissMessage.Show()
+ PetFramework_ParentQuest.DecrementPetCount()
+
+ debug.trace("Pet Count: " + PetFramework_ParentQuest.GetCurrentPetCount())
+
+EndFunction
+
+
+
From 138e14d95bfe2df959e72a43e74e9377c9fb4288 Mon Sep 17 00:00:00 2001
From: absol89
Date: Sat, 30 Nov 2024 21:53:04 +0100
Subject: [PATCH 8/9] Bugfix: Prevent players from recruiting pets on public
servers and cause crashes
Displays the dismiss message and returns, instead of making the CC pet stalk the party
---
.../scripts/PetFramework_ParentQuestScript.pex | Bin 0 -> 3642 bytes
.../Skyrim/scripts/petframework_petquest.pex | Bin 0 -> 5032 bytes
.../source/PetFramework_ParentQuestScript.psc | 3 ++-
.../scripts/source/PetFramework_PetQuest.psc | 3 ++-
4 files changed, 4 insertions(+), 2 deletions(-)
create mode 100644 GameFiles/Skyrim/scripts/PetFramework_ParentQuestScript.pex
create mode 100644 GameFiles/Skyrim/scripts/petframework_petquest.pex
diff --git a/GameFiles/Skyrim/scripts/PetFramework_ParentQuestScript.pex b/GameFiles/Skyrim/scripts/PetFramework_ParentQuestScript.pex
new file mode 100644
index 0000000000000000000000000000000000000000..493338529d85085b0be1712d0c0cc97da70bc8c0
GIT binary patch
literal 3642
zcma)8>2}jb6#nET34tVJ!$}}P&?Rjt5W*U_4OyLptY9F}($a}Nwnbzqm1F`h(m#EX
z{^>b=gg!z09{tsCMpk6SrU%WLoAj*7
zpcsfi;>?;GxZ$#E*V%Ba07GOhH$1f`4K2G3CqOT;ZSjt@kHHP6JU*%_^6rgRG7dZ@A&jq72MR!zn2d
z->kTvc|@e7JTiq-Hf^hJk*>+op?||%v~AN3YSJ_P8Z%a=pc8nm?VF@b%Q2H_VFtov
z;%YumcV>(7t@JEsTR5(_>WBkdZVT^FdavIK5B;93NT#GDg$e?r`TVIIX|ePMlQo&o
zFTLDdpSiW-y55#Jly5D0tj%f}ve(^u)A+vSl>I=IKfrF+p2+7DaWr!rI$5>d17Xu&
zOSz9>%G%<+^a?`fPz!ZeLIP8*eymITjqsRCXIB
ztr3iUC}!jm`^R2m;8X!&uq`hbi=#@W5`Br2MPK3|FcIsWcDos2dvW6CGLN43=HR_K
zU8-4jd0OAM)#9FibG5kTn}KUqc>(LB2}g7R?J^iuT<_<
z*mz8RVp)h31nI)`5R)1$0z-W%*`!yh=$q=^x3G
zRk3&{SXz87dmMS(d@PFr--;@FU1!xPhZsvUT%2>AC0VtckeW{J=gFYq@i|lWOW`xy
zwB9W3S
zUg8J5!jE{3pCP#MSp(CMKEw
z@yLLQFBp{y+vsM1U&fp%d==|V;9ATXhxP&xt`z;PyY_?#ww}`9#ADaWZ<5GK`l?kd-^ES1|Bp)qmK)c
zBZ^_5muBW7GiQ;IafGWISZWTxPdhT>jv`5Rw|uI|N2)7
z8}#y9V%+B;SM5T7+)W5AbP!5o_DTwmVoQr1g?@jM5L)UaWc2-$5L)gegqhzGLMxqw
z4D(e&Xtkq|lT8Q}D8y6TG%#RbUgw;736YC2vJfJ}F|rsUmt$lpL?&ZoIYdTdWFWEG$lx^k?
z8M|EvpXs30^U?sjJpXm23DDT-m8{ElfFhwufK3lGp!S*+Vl)>NR?RmxB
Mhu9fUKBYYPACRat1^@s6
literal 0
HcmV?d00001
diff --git a/GameFiles/Skyrim/scripts/petframework_petquest.pex b/GameFiles/Skyrim/scripts/petframework_petquest.pex
new file mode 100644
index 0000000000000000000000000000000000000000..3e802ab16c77e0d22f0a61ab5852c5638e7f5203
GIT binary patch
literal 5032
zcmb_e*;*UP6+SHx0&KGw;{|(2+2ag0#tf?gWhN8M=7r6`m`TPeM;^S*m|J{@XvhGUO0`rI#Nk>DIo8
zH$z?(4H;J6WAdslqIkL%xs>H6k@RVBedF-u(cb>!^|_Vpt(85h(`Ze^#dH%UAJitO
z?A;RaVa#JeeOoe?hP=7MD*~EV&$#FF6JH$3eV?C;kj4_uw*l|qUEY+wFB^&Em1FM3
zn=(wMHxEVpOje<3tsaIVh_|K7V^0Ru56-S=C?;KUWl-?cGWV&c>=g$5#jqY9@0Q4iUP*Fg8Lqi=)RV13C6k?RlO+M
z5m5wV^{!miOlYE0e20HL5Zo<`!o?k5bP5`5y`Z!SbK#EBTr?9J)*B8)aaGx+c_VtM
z&4KZD#lR#m38XiT1J?^_qPaR#3_7Hg>O{C`#qE54N1nm7BUvi>VxPMexV~ph?0zbd
zk)O4nixj@#$4wx90mY_KG~UWVU|R5{OW<3#iM0#2gGP7TB|7k@(O>k1uC(|~H`)~?
z?$9+bI+6#wP4=5yqV8Q8AlU=aNUI=MFpg1AK_2t4Mt%9bl6sA_>&@q5QLW7`p}8>e|`S#$H$^*o5v=>qi}#vx*4S7ui%H8(@qO<(e+@NCMOqijK()Jv3&
zL+%Q?k6L9YR;Kc*rI@r~tQN|T=hPhuzevOAEUU^~#K#m34Q`xqzm8^;OqvyOQ`#>EE_buF5FO5k;=e%P1fP~RcKB+
zO}eI%g=u!4(GSmytf=ZehAfXgc=aP`pU)M}WYLrEw&(r0`szSu3)1fWJBJ{X6
zHfepzh!erm7Mz$;tA}oxtK&lvxpn+EaF#d|s=JARhn_@NJoe(UtiwrVomJ@aAds#+j~ivUM)gsb7jXuHY}z+kFKIjsPRYQpu39#DYwxEXsAFh|4l~
zDoS2pW)rRFgd(noxO|je*W7%G)^Co&y7+RFBVY2WbD0EbAiJBP)`_M9fqOCbf;vEz
z;HqnO+H?xkLXu0%mPjjmb|yt)mhQIP$F_EXLYb+egbnlvR-|p10XZC5Qdg}yH8sp+
zKV=oNuW3lBg;?{ZpZ}DWD3?N@-T*muOpTF9Wk~6R?@6XQ+gN$9-9VSd@R+lB%v)l?5{s62Vu>Z{f5s!+1~5LNLA+Ut1dzFdGB;?X_-kmAk0O2X
z=%^?pj2WtHVdnt)(1jJs;Q~`%RMfK(=>Os8L0j)iKJ^-Zre1uYIh0YKev0U_L^ok^
z7(=aQ)#L_-n)DDorg4m4VceyA^m#h&Q~Q{pNsOtE@g>b*%<8c~i^*7~Wqm}BXoyzz
zSfe#sr;TK6(K9`^XnXZ6PpUM3+K!a*knW+%M@2Vw6=$cs>wKCT&af5Ce)-5YD
zMz^t&0ls(aQa^nLF@0zbh>t^WG8qEigLX1X3_B9e2;z{6T}4Q4YmSqnF~lYnyM^$i
zlRNb5rnUk4qB*&a%?=Wyk0#6kgtT}7{zK@U#M4KQz?woDOp^-aEX~n8Er4F6C$xlT
z8PE7FhgKZQJM>6pRVG8f(b;vwp`1fsCCg5ht~fN7b+G)kL!%B&S*hQGPNWFjZyb8y
z(6r_L&Y|m82bMuURIKh!J*!PU8HYx+f@|vSz`~~vtywkQU;p^y-?cUByiZtz!zPu2
zzIFv)eg2PrV=5d;O*NJ;=z|9wTC~KHC6+aTjqBKzSd(>V0kRG)IkcQ5V=zQE92#TJX!2~^5N2*_jULXrp
zHe{gBAojvK1KeLErvdjnW_veeUz*Ko`*z3n?F-wt+qSE$oS+@My@z&@b9;D{1^dXk
zS9lKa^uZdS4ySglI!qChJv#-`yG^9`+CbFlXcU+o(6q0&f_P<#1FP&1iW6mB5QKDGyMbCeT#y?<02}V}DgwLP?tfr!}D>f?~VsP+6`2cg3cioirLyuK$CE
zv1SkQv|T{=)FBViJIzplx1#h!wthhgUGgk@&-@
zm5w7T_Q=-e-l-XF0h-O7khJ4w^KZAba?w>x{(qJt%td8#4=gmj!M7fS4*7|NsMt<^
i)WT0YbNox)RYzVmB7mmh)7|y-U&GfH2V}NIi+%
Date: Sat, 30 Nov 2024 20:04:58 -0500
Subject: [PATCH 9/9] Windows 11 24H2 changed some low-level call hierarchies.
This is a compatibility change, works on 23H2 and 24H2. Since in 24H2
GetModuleHandle no longer down-calls to LdrGetDllHandleEx, have to hook the
GetModuleHandle() routines also.
Windows 11 24H2 changed some low-level call hierarchies.
This is a compatibility change, works on 23H2 and 24H2. Since in 24H2 GetModuleHandle no longer down-calls to LdrGetDllHandleEx, have to hook the GetModuleHandle() routines also.
---
Code/immersive_launcher/TargetConfig.h | 1 +
Code/immersive_launcher/stubs/FileMapping.cpp | 30 ++++++++++++++++++-
2 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/Code/immersive_launcher/TargetConfig.h b/Code/immersive_launcher/TargetConfig.h
index 4cc87635e..a68db909b 100644
--- a/Code/immersive_launcher/TargetConfig.h
+++ b/Code/immersive_launcher/TargetConfig.h
@@ -25,6 +25,7 @@ static constexpr TargetConfig CurrentTarget{
L"Skyrim Special Edition",
489830, 0x40000000, 35410264};
#define TARGET_NAME L"SkyrimSE"
+#define TARGET_NAME_A "SkyrimSE"
#define PRODUCT_NAME L"Skyrim Together"
#define SHORT_NAME L"Skyrim Special Edition"
diff --git a/Code/immersive_launcher/stubs/FileMapping.cpp b/Code/immersive_launcher/stubs/FileMapping.cpp
index 67b4f5d5a..4776b9b95 100644
--- a/Code/immersive_launcher/stubs/FileMapping.cpp
+++ b/Code/immersive_launcher/stubs/FileMapping.cpp
@@ -26,7 +26,7 @@ std::wstring s_OverridePath;
DWORD(WINAPI* RealGetModuleFileNameW)(HMODULE, LPWSTR, DWORD) = nullptr;
DWORD(WINAPI* RealGetModuleFileNameA)(HMODULE, LPSTR, DWORD) = nullptr;
HMODULE(WINAPI* RealGetModuleHandleW)(LPCWSTR) = nullptr;
-HMODULE(WINAPI* RealGetModuleHandleA)(LPSTR) = nullptr;
+HMODULE(WINAPI* RealGetModuleHandleA)(LPCSTR) = nullptr;
NTSTATUS(WINAPI* RealLdrLoadDll)(const wchar_t*, uint32_t*, UNICODE_STRING*, HANDLE*) = nullptr;
NTSTATUS(WINAPI* RealLdrGetDllHandle)(PWSTR, PULONG, PUNICODE_STRING, PVOID*) = nullptr;
NTSTATUS(WINAPI* RealLdrGetDllFullName)(HMODULE, PUNICODE_STRING) = nullptr;
@@ -87,6 +87,28 @@ bool IsLocalModulePath(HMODULE aHmod)
return buf.find(s_OverridePath) != std::wstring::npos;
}
+// some mods do GetModuleHandle("SkyrimSE.exe") for some reason instead of GetModuleHandle(nullptr)
+HMODULE WINAPI TP_GetModuleHandleW(LPCWSTR lpModuleName)
+{
+ constexpr auto pTarget = TARGET_NAME L".exe";
+ auto targetSize = std::wcslen(pTarget);
+
+ if (lpModuleName && std::wcsncmp(pTarget, lpModuleName, targetSize) == 0)
+ lpModuleName = nullptr;
+ return RealGetModuleHandleW(lpModuleName);
+}
+
+// some mods do GetModuleHandle("SkyrimSE.exe") for some reason instead of GetModuleHandle(nullptr)
+HMODULE WINAPI TP_GetModuleHandleA(LPCSTR lpModuleName)
+{
+ constexpr auto pTarget = TARGET_NAME_A ".exe";
+ constexpr auto targetSize = sizeof(TARGET_NAME_A ".exe");
+
+ if (lpModuleName && std::strncmp(pTarget, lpModuleName, targetSize) == 0)
+ lpModuleName = nullptr;
+ return RealGetModuleHandleA(lpModuleName);
+}
+
// some mods do GetModuleHandle("SkyrimSE.exe") for some reason instead of GetModuleHandle(nullptr)
NTSTATUS WINAPI TP_LdrGetDllHandle(PWSTR DllPath, PULONG DllCharacteristics, PUNICODE_STRING DllName, PVOID* DllHandle)
{
@@ -300,6 +322,12 @@ void CoreStubsInit()
// TODO(Vince): we need some check if usvfs already fucked with this?
// MH_CreateHookApi(L"ntdll.dll", "LdrGetDllFullName", &TP_LdrGetDllFullName, (void**)&RealLdrGetDllFullName);
VALIDATE(MH_CreateHookApi(L"ntdll.dll", "LdrLoadDll", &TP_LdrLoadDll, (void**)&RealLdrLoadDll));
+
+ // Starting with Windows 11 24H2 the call stack has changed and GetModuleHandle() no longer
+ // downcalls to LdrGetDllHandleEx, so we have to hook this too.
+ VALIDATE(MH_CreateHookApi(L"kernel32.dll", "GetModuleHandleW", &TP_GetModuleHandleW, (void**)&RealGetModuleHandleW));
+ VALIDATE(MH_CreateHookApi(L"kernel32.dll", "GetModuleHandleA", &TP_GetModuleHandleA, (void**)&RealGetModuleHandleA));
+
VALIDATE(MH_EnableHook(nullptr));
}