summaryrefslogtreecommitdiff
path: root/lib/VNDB/DB
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2016-07-03 11:12:42 +0200
committerYorhel <git@yorhel.nl>2016-07-03 11:12:42 +0200
commit92235222dba4e5d0c7713d53ef12e0f10e371b83 (patch)
tree685e370a7767882c7ac9d75a945a7d5143b73c88 /lib/VNDB/DB
parent7da2edeaa0f6cf7794f4f8f68960497dc1be893c (diff)
Charedit/traits: Prioritize exact match when finding traits
Diffstat (limited to 'lib/VNDB/DB')
-rw-r--r--lib/VNDB/DB/Traits.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/VNDB/DB/Traits.pm b/lib/VNDB/DB/Traits.pm
index 45173f6e..f2eadaba 100644
--- a/lib/VNDB/DB/Traits.pm
+++ b/lib/VNDB/DB/Traits.pm
@@ -30,7 +30,8 @@ sub dbTraitGet {
my %where = (
$o{id} ? ( 't.id IN(!l)' => [ ref($o{id}) ? $o{id} : [$o{id}] ]) : (),
$o{group} ? ( 't.group = ?' => $o{group} ) : (),
- $o{noid} ? ( 't.id <> ?' => $o{noid} ) : (),
+ $o{noid} && ref($o{noid}) && @{$o{noid}} ? ('t.id NOT IN(!l)', [$o{noid}]) : (),
+ $o{noid} && !ref($o{noid}) ? ('t.id <> ?' => $o{noid}) : (),
defined $o{state} && $o{state} != -1 ? (
't.state = ?' => $o{state} ) : (),
!defined $o{state} && !$o{id} && !$o{name} ? (