Fix passenger vs player bug.

This commit is contained in:
BubbaGumpShrump 2025-01-11 10:58:36 -05:00
parent 2d5d1f9f99
commit 52d5e6cc37

View file

@ -114,7 +114,6 @@ if (Test-Path "$scriptFolder\Kill-Log.csv") {
$killDate = [datetime]::parseExact($kill.KillTime, $dateFormat, $null) $killDate = [datetime]::parseExact($kill.KillTime, $dateFormat, $null)
If ($killdate.year -eq $currentDate.Year -and $killdate.month -eq $currentDate.Month) { If ($killdate.year -eq $currentDate.Year -and $killdate.month -eq $currentDate.Month) {
$global:killTally++ $global:killTally++
} }
Try { Try {
Write-Output "NewKill=throwaway,$($kill.EnemyPilot),$($kill.EnemyShip),$($kill.OrgAffiliation),$($kill.Enlisted),$($kill.RecordNumber),$($kill.KillTime), $($kill.PFP)" 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)) { if ($null -eq (Get-Process -ID $parentApp -ErrorAction SilentlyContinue)) {
Stop-Process -Id $PID -Force Stop-Process -Id $PID -Force
} }
If ($enemyShip -ne "Player"){
If ($enemyShip -eq $global:lastKill -and $global:lastKill -ne "Player"){ If ($enemyShip -eq $global:lastKill){
$enemyShip = "Passenger" $enemyShip = "Passenger"
} Else { } Else {
$global:lastKill = $enemyShip $global:lastKill = $enemyShip
}
} }
If ($player -eq $global:userName -and $enemyPilot -ne $global:userName){ If ($player -eq $global:userName -and $enemyPilot -ne $global:userName){