working
This commit is contained in:
@@ -4,15 +4,37 @@ param(
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$targetClass = Join-Path $GameRoot "zombie\vehicles\BaseVehicle.class"
|
||||
$backupClass = "$targetClass.landtrain.original"
|
||||
$targets = @(
|
||||
(Join-Path $GameRoot "zombie\vehicles\BaseVehicle.class"),
|
||||
(Join-Path $GameRoot "java\zombie\vehicles\BaseVehicle.class")
|
||||
)
|
||||
$helperTargets = @(
|
||||
(Join-Path $GameRoot "zombie\vehicles\LandtrainConstraintAuthHelper.class"),
|
||||
(Join-Path $GameRoot "java\zombie\vehicles\LandtrainConstraintAuthHelper.class")
|
||||
)
|
||||
|
||||
if (Test-Path $backupClass) {
|
||||
Copy-Item $backupClass $targetClass -Force
|
||||
Write-Output "Restored BaseVehicle.class from $backupClass"
|
||||
} elseif (Test-Path $targetClass) {
|
||||
Remove-Item $targetClass -Force
|
||||
Write-Output "Removed override class at $targetClass (game will use class from projectzomboid.jar)"
|
||||
} else {
|
||||
Write-Output "No override or backup found. Nothing to restore."
|
||||
$handled = $false
|
||||
foreach ($targetClass in $targets | Select-Object -Unique) {
|
||||
$backupClass = "$targetClass.landtrain.original"
|
||||
if (Test-Path $backupClass) {
|
||||
Copy-Item $backupClass $targetClass -Force
|
||||
Write-Output "Restored BaseVehicle.class from $backupClass"
|
||||
$handled = $true
|
||||
} elseif (Test-Path $targetClass) {
|
||||
Remove-Item $targetClass -Force
|
||||
Write-Output "Removed override class at $targetClass (game will use class from projectzomboid.jar)"
|
||||
$handled = $true
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($helperClass in $helperTargets | Select-Object -Unique) {
|
||||
if (Test-Path $helperClass) {
|
||||
Remove-Item $helperClass -Force
|
||||
Write-Output "Removed helper override class at $helperClass"
|
||||
$handled = $true
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $handled) {
|
||||
Write-Output "No override or backup found in known client/dedicated paths. Nothing to restore."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user