From 52d5e6cc37b461a74ae3b5d3a2d0167512ed04b0 Mon Sep 17 00:00:00 2001
From: BubbaGumpShrump <joshua.p.farrell@gmail.com>
Date: Sat, 11 Jan 2025 10:58:36 -0500
Subject: [PATCH] Fix passenger vs player bug.

---
 AutoTrackR2/KillTrackR_MainScript.ps1 | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/AutoTrackR2/KillTrackR_MainScript.ps1 b/AutoTrackR2/KillTrackR_MainScript.ps1
index 92130b2..243a8a7 100644
--- a/AutoTrackR2/KillTrackR_MainScript.ps1
+++ b/AutoTrackR2/KillTrackR_MainScript.ps1
@@ -114,7 +114,6 @@ if (Test-Path "$scriptFolder\Kill-Log.csv") {
 		$killDate = [datetime]::parseExact($kill.KillTime, $dateFormat, $null)
 		If ($killdate.year -eq $currentDate.Year -and $killdate.month -eq $currentDate.Month) {
 			$global:killTally++
-
 		}
 		Try {
 			Write-Output "NewKill=throwaway,$($kill.EnemyPilot),$($kill.EnemyShip),$($kill.OrgAffiliation),$($kill.Enlisted),$($kill.RecordNumber),$($kill.KillTime), $($kill.PFP)"
@@ -205,11 +204,12 @@ function Read-LogEntry {
 			if ($null -eq (Get-Process -ID $parentApp -ErrorAction SilentlyContinue)) {
 				Stop-Process -Id $PID -Force
 			}
-			
-			If ($enemyShip -eq $global:lastKill -and $global:lastKill -ne "Player"){
-				$enemyShip = "Passenger"
-			} Else {
-				$global:lastKill = $enemyShip
+			If ($enemyShip -ne "Player"){
+				If ($enemyShip -eq $global:lastKill){
+					$enemyShip = "Passenger"
+				} Else {
+					$global:lastKill = $enemyShip
+				}
 			}
 
 			If ($player -eq $global:userName -and $enemyPilot -ne $global:userName){