refactor: merge ifs and remove unnecessary check
This commit is contained in:
parent
379870028a
commit
5e50078d59
|
@ -62,22 +62,17 @@ namespace XivCommon.Functions {
|
|||
}
|
||||
}
|
||||
|
||||
if (this.JoinsEnabled) {
|
||||
if (scanner.TryScanText(Signatures.JoinCrossParty, out var joinPtr, "Party Finder joins")) {
|
||||
this.JoinPfHook = new Hook<JoinPfDelegate>(joinPtr, new JoinPfDelegate(this.JoinPfDetour));
|
||||
this.JoinPfHook.Enable();
|
||||
if (this.JoinsEnabled && scanner.TryScanText(Signatures.JoinCrossParty, out var joinPtr, "Party Finder joins")) {
|
||||
this.JoinPfHook = new Hook<JoinPfDelegate>(joinPtr, new JoinPfDelegate(this.JoinPfDetour));
|
||||
this.JoinPfHook.Enable();
|
||||
|
||||
this.PartyFinderGui.ReceiveListing += this.ReceiveListing;
|
||||
}
|
||||
this.PartyFinderGui.ReceiveListing += this.ReceiveListing;
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Dispose() {
|
||||
if (this.JoinsEnabled) {
|
||||
this.PartyFinderGui.ReceiveListing -= this.ReceiveListing;
|
||||
}
|
||||
|
||||
this.PartyFinderGui.ReceiveListing -= this.ReceiveListing;
|
||||
this.JoinPfHook?.Dispose();
|
||||
this.RequestPfListingsHook?.Dispose();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user