Skip to content

Commit

Permalink
Remove duplicate FindPRL in WitnessSuspect methods
Browse files Browse the repository at this point in the history
  • Loading branch information
wallabra committed Dec 7, 2023
1 parent fb9305e commit 415627a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Classes/MushMatchMutator.uc
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,8 @@ simulated function LinearChanceSkew(out float Chance, float Skew) {
}
}

function bool BasicWitnessSuspect(Pawn Victim, Pawn InstigatedBy, Pawn Witness) {
function bool BasicWitnessSuspect(Pawn Victim, Pawn InstigatedBy, Pawn Witness, out MushMatchPRL WitPRL, out MushMatchPRL VictPRL, out MushMatchPRL InstigPRL) {
// Basic sanity checks for whether a bot's personal suspicion is valid.
local MushMatchPRL WitPRL, VictPRL, InstigPRL;

if (!Witness.bIsPlayer) {
return false;
}
Expand Down Expand Up @@ -320,14 +318,10 @@ function bool WitnessSuspect(Pawn Victim, Pawn InstigatedBy, Pawn Witness, int D
local MushMatchPRL WitPRL, VictPRL, InstigPRL;
local float SuspectOverlookChance;

if (!BasicWitnessSuspect(Victim, InstigatedBy, Witness)) {
if (!BasicWitnessSuspect(Victim, InstigatedBy, Witness, )WitPRL, VictPRL, InstigPRL) {
return false;
}

WitPRL = FindPawnPRL(Witness);
InstigPRL = FindPawnPRL(InstigatedBy);
VictPRL = FindPawnPRL(Victim);

// must have line of sight to the perpetrator
if (!Witness.LineOfSightTo(InstigatedBy)) {
//Log("Ruled out suspicion for lack of line of sight to the perpetrator. Instigator:" @ InstigatedBy.PlayerReplicationInfo.PlayerName $"; victim:"@ Victim.PlayerReplicationInfo.PlayerName $"; witness:"@ Witness.PlayerReplicationInfo.PlayerName);
Expand Down

0 comments on commit 415627a

Please sign in to comment.