Commit 27eba740 authored by Gerard Gascón's avatar Gerard Gascón
Browse files

fix: negative color error

parent ef61225e
Loading
Loading
Loading
Loading
+178 B (1.7 KiB)
Loading image diff...
+6 −0
Original line number Diff line number Diff line
@@ -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