diff --git a/source/modules/mod_doomrla.rb b/source/modules/mod_doomrla.rb index d2945e3..6f542ac 100644 --- a/source/modules/mod_doomrla.rb +++ b/source/modules/mod_doomrla.rb @@ -34,7 +34,7 @@ class Mod_DoomRLA < Vrobot4::Module::Module def c_assemblyinfo m, argv t = "" - w = @winfo.select {|wep| wep if wep["Assembly"] and wep["AssemblyItem"].casecmp? argv} + w = @winfo.select {|wep| wep if wep["Assembly"] and wep["AssemblyItem"].casecmp(argv) == 0} raise ArgumentError, "No assemblies found" if w == nil || w.empty? w.each {|wep| t << wep["Assembly"] + " - " + wep["Name"] + "\n"} @@ -42,7 +42,7 @@ class Mod_DoomRLA < Vrobot4::Module::Module end def c_weaponinfo m, argv - w = @winfo.find {|wep| wep if wep["Name"].casecmp? argv} + w = @winfo.find {|wep| wep if wep["Name"].casecmp(argv) == 0} raise ArgumentError, "Weapon not found" if w == nil t = "#{w["Damage"]} #{w["DamageType"]} damage\n" @@ -64,7 +64,7 @@ class Mod_DoomRLA < Vrobot4::Module::Module def c_monsterinfo m, argv mi = @minfo.select do |mon| - mon if mon["Name"].casecmp? argv or mon["Tags"].split(", ").include? argv + mon if mon["Name"].casecmp(argv) == 0 or mon["Tags"].split(", ").include? argv end raise ArgumentError, "No monsters found" if mi == nil || mi.empty? diff --git a/source/modules/mod_dtl.rb b/source/modules/mod_dtl.rb index fd59dff..d2cbd7d 100644 --- a/source/modules/mod_dtl.rb +++ b/source/modules/mod_dtl.rb @@ -22,7 +22,7 @@ class Mod_DecatessaradimensionalLoungeAlertationAndRolinationManagerator < Vrobo def get_role m, argv roles = m.chan.real.server.roles - role = roles.find {|r| r.name.casecmp? argv} + role = roles.find {|r| r.name.casecmp(argv) == 0} unless role and @info.any? {|id| role.id == id} raise ArgumentError, "Invalid notification group, use `.listnotify` for a list of available groups." end diff --git a/source/modules/mod_notify.rb b/source/modules/mod_notify.rb index 79e3e01..9f0d44b 100644 --- a/source/modules/mod_notify.rb +++ b/source/modules/mod_notify.rb @@ -12,7 +12,7 @@ class Mod_Notify < Vrobot4::Module::Module def get_role m, argv roles = m.chan.real.server.roles - role = roles.find {|r| r.name.casecmp? argv} + role = roles.find {|r| r.name.casecmp(argv) == 0} unless role and @info.any? {|id| role.id == id} raise ArgumentError, "Invalid notification group, use `.listnotify` for a list of available groups." end