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 (this.JoinsEnabled && scanner.TryScanText(Signatures.JoinCrossParty, out var joinPtr, "Party Finder joins")) {
|
||||||
if (scanner.TryScanText(Signatures.JoinCrossParty, out var joinPtr, "Party Finder joins")) {
|
this.JoinPfHook = new Hook<JoinPfDelegate>(joinPtr, new JoinPfDelegate(this.JoinPfDetour));
|
||||||
this.JoinPfHook = new Hook<JoinPfDelegate>(joinPtr, new JoinPfDelegate(this.JoinPfDetour));
|
this.JoinPfHook.Enable();
|
||||||
this.JoinPfHook.Enable();
|
|
||||||
|
|
||||||
this.PartyFinderGui.ReceiveListing += this.ReceiveListing;
|
this.PartyFinderGui.ReceiveListing += this.ReceiveListing;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void Dispose() {
|
public void Dispose() {
|
||||||
if (this.JoinsEnabled) {
|
this.PartyFinderGui.ReceiveListing -= this.ReceiveListing;
|
||||||
this.PartyFinderGui.ReceiveListing -= this.ReceiveListing;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.JoinPfHook?.Dispose();
|
this.JoinPfHook?.Dispose();
|
||||||
this.RequestPfListingsHook?.Dispose();
|
this.RequestPfListingsHook?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user