mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-23 03:23:17 -04:00
Thwart the nathty dithband thpammer (#11790)
This commit is contained in:
parent
9431e3cbc4
commit
33f73f5aae
@ -933,6 +933,9 @@ class MapUnit : IsPartOfGameInfoSerialization {
|
||||
}
|
||||
|
||||
fun disband() {
|
||||
// Safeguard against running on already destroyed instances
|
||||
if (isDestroyed) return
|
||||
|
||||
// evacuation of transported units before disbanding, if possible. toListed because we're modifying the unit list.
|
||||
for (unit in currentTile.getUnits()
|
||||
.filter { it.isTransported && isTransportTypeOf(it) }
|
||||
|
@ -60,6 +60,7 @@ class UnitActionsTable(val worldScreen: WorldScreen) : Table() {
|
||||
}
|
||||
|
||||
clear()
|
||||
keyShortcuts.clear()
|
||||
if (unit == null) return
|
||||
if (!worldScreen.canChangeState) return // No actions when it's not your turn or spectator!
|
||||
|
||||
@ -127,7 +128,6 @@ class UnitActionsTable(val worldScreen: WorldScreen) : Table() {
|
||||
pack()
|
||||
|
||||
// Bind all currently invisible actions to their keys
|
||||
keyShortcuts.clear()
|
||||
for (page in pageActionBuckets.indices) {
|
||||
if (page == currentPage) continue // these are already done
|
||||
for (unitAction in pageActionBuckets[page]) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user