fix: add some instance checks

This commit is contained in:
Anna
2022-06-01 17:43:19 -04:00
parent e1c6a88012
commit 8ef91ef640
2 changed files with 15 additions and 3 deletions
+11
View File
@@ -33,6 +33,9 @@ internal unsafe class GameFunctions : IDisposable {
[Signature("E8 ?? ?? ?? ?? EB 20 48 8B 46 28", Fallibility = Fallibility.Fallible)]
private readonly delegate* unmanaged<AgentInterface*, uint, void> _openAchievement = null!;
[Signature("E8 ?? ?? ?? ?? 84 C0 49 8B DE", Fallibility = Fallibility.Fallible)]
private readonly delegate* unmanaged<byte> _inInstance = null!;
#endregion
#region Hooks
@@ -255,6 +258,14 @@ internal unsafe class GameFunctions : IDisposable {
}
}
internal bool IsInInstance() {
if (this._inInstance == null) {
return false;
}
return this._inInstance() != 0;
}
internal void ClickNoviceNetworkButton() {
var agent = Framework.Instance()->GetUiModule()->GetAgentModule()->GetAgentByInternalId(AgentId.ChatLog);
// case 3