With your help I was able to fix the main bug in my script, thank you Charlie!
Bugfix #1
Code:
#-----------------------------------------------------------------------------
# * Alias Listings
#-----------------------------------------------------------------------------
alias_method :smartstate_gmenemy_actions, :actions
#-----------------------------------------------------------------------------
# * Actions
#-----------------------------------------------------------------------------
def actions
# Clone action list
actions, remove = smartstate_gmenemy_actions.dup, Array.new
# For each action
actions.each do |action|
# If action conditions are met
if smartstate_action_fix?(action)
# Put this action in the remove list
remove << action
end
end
# Remove each action
remove.each {|action| actions.delete(action)}
# Return modified list
actions
end
I haven't had time to test it yet, but this might've solved the 2nd bug. Anyways, thank you for your help.