fix: negative color error

This commit is contained in:
Gerard Gascón 2025-04-23 15:07:42 +02:00
parent ef61225eb7
commit 27eba74018
2 changed files with 6 additions and 0 deletions

BIN
icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before After
Before After

View file

@ -31,6 +31,10 @@ func pick_previous() -> SpriteFrames:
return _pick_non_nullable()
func _get_array_index(index: int, size: int) -> int:
return ((index % size) + size) % len(outfits)
func _pick_nullable() -> SpriteFrames:
_index %= (len(outfits) + 1)
if _index == 0:
@ -45,6 +49,8 @@ func _pick_non_nullable() -> SpriteFrames:
func get_texture(index: int) -> SpriteFrames:
if not allow_null:
index = _get_array_index(index, len(outfits))
if index < 0 or index >= len(outfits):
return null