Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gs][stash.rb] bugfix: UserVars String class check #747

Merged
merged 1 commit into from
Feb 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/stash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ def self.stash_hands(right: false, left: false, both: false)
sheath = second_sheath = nil
end
# weaponsack for both hands
if UserVars.weapon and UserVars.weaponsack and not UserVars.weapon.empty? and not UserVars.weaponsack.empty? and (right_hand.name =~ /#{Regexp.escape(UserVars.weapon.strip)}/i or right_hand.name =~ /#{Regexp.escape(UserVars.weapon).sub(' ', ' .*')}/i)
if UserVars.weapon.class == String and UserVars.weaponsack.class == String and not UserVars.weapon.empty? and not UserVars.weaponsack.empty? and (right_hand.name =~ /#{Regexp.escape(UserVars.weapon.strip)}/i or right_hand.name =~ /#{Regexp.escape(UserVars.weapon).sub(' ', ' .*')}/i)
weaponsack = nil unless (weaponsack = find_container(UserVars.weaponsack, loud_fail: false)).is_a?(Lich::Gemstone::GameObj)
end
# lootsack for both hands
if UserVars.lootsack.nil? or UserVars.lootsack.empty?
if UserVars.lootsack.class != String || UserVars.lootsack.empty?
lootsack = nil
else
lootsack = nil unless (lootsack = find_container(UserVars.lootsack, loud_fail: false)).is_a?(Lich::Gemstone::GameObj)
Expand Down