Fixed crash when policy prerequisite is a branch (#8273)

Co-authored-by: tunerzinc@gmail.com <vfylfhby>
This commit is contained in:
vegeta1k95 2022-12-30 13:30:02 +01:00 committed by GitHub
parent 38d13570a7
commit 41b5cfa9b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -446,13 +446,17 @@ class PolicyPickerScreen(val worldScreen: WorldScreen, civInfo: CivilizationInfo
continue continue
val prereqButton = policyNameToButton[prereqName] val prereqButton = policyNameToButton[prereqName]
drawLine(group, if (prereqButton != null) {
// Top center drawLine(
policyButton.x+policyButton.width/2, group,
policyButton.y+policyButton.height, // Top center
// Bottom center policyButton.x + policyButton.width / 2,
prereqButton!!.x + prereqButton.width/2, policyButton.y + policyButton.height,
prereqButton.y) // Bottom center
prereqButton.x + prereqButton.width / 2,
prereqButton.y
)
}
} }
} }