Skip to content

Commit ed41d16

Browse files
committed
Check for empty arrays the right way
derp
1 parent d0cbfa8 commit ed41d16

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

AutoLoad/GameState.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func removePlayer(playerToRemove: Entity) -> bool:
9696
playersChanged.emit()
9797

9898
# Did everyone die?
99-
if players.size() < 1: gameDidOver.emit()
99+
if players.is_empty(): gameDidOver.emit()
100100

101101
return true
102102

AutoLoad/GlobalOverlay.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func playAudioPlayerPool(
135135

136136
var audioPlayer: AudioStreamPlayer2D
137137

138-
if audioPlayers.size() <= 0:
138+
if audioPlayers.is_empty():
139139
createAudioPlayerPool()
140140
# TBD: Debug.printWarning("No AudioStreamPlayer2D in audioPlayers pool", self)
141141
# return null

Components/Combat/DamageReceivingComponent.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func onAreaExited(areaExited: Area2D) -> void:
8080
if damageComponent: damageComponentsInContact.erase(damageComponent)
8181

8282
# Reset the `accumulatedFractionalDamage` if there is no source of damage in contact.
83-
if damageComponentsInContact.size() <= 0:
83+
if damageComponentsInContact.is_empty():
8484
accumulatedFractionalDamage = 0
8585

8686

Components/Movement/RelativePathMovementComponent.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ signal didFinishMove
4949

5050

5151
func _ready() -> void:
52-
if vectors.size() < 1:
52+
if vectors.is_empty():
5353
printWarning("No vectors in list")
5454
self.hasNoMoreMoves = true
5555
return

0 commit comments

Comments
 (0)