Certain functions return -1 to indicate that no matching value is found. Examples: has_item and has_battle_command in lib/Entity/entity.rb. We should change it so that it returns nil instead of -1. This will result in cleaner code since we can change the following:
index = has_item(Item.new)
if (index != -1)
# ...
end
Certain functions return -1 to indicate that no matching value is found. Examples:
has_item
andhas_battle_command
in lib/Entity/entity.rb. We should change it so that it returns nil instead of -1. This will result in cleaner code since we can change the following:to this: