This commit is contained in:
Igor Barkov [iwork] 2018-11-01 17:33:21 +02:00
parent 6dbcf227a3
commit c8bf20fea0

View File

@ -2264,33 +2264,33 @@ function ref_drop()
}
}
}
if ($dd = db::c()->query("SELECT i.`id` FROM`users` AS `u`, `inventory` AS `i`
if ($dd = db::c()->query("SELECT `i`.`id` FROM `users` AS `u`, `inventory` AS `i`
WHERE
i.needident = 0 AND
i.id = {$id} AND
i.duration < i.maxdur AND
i.owner = {$user['id']} AND
u.sila >= i.nsila AND
u.lovk >= i.nlovk AND
u.inta >= i.ninta AND
u.vinos >= i.nvinos AND
u.intel >= i.nintel AND
u.mudra >= i.nmudra AND
u.level >= i.nlevel AND
($al OR (" . (int)$user['align'] . " = i.nalign) or (i.nalign = 0)) AND
u.noj >= i.nnoj AND
u.topor >= i.ntopor AND
u.dubina >= i.ndubina AND
u.mec >= i.nmech AND
u.mfire >= i.nfire AND
u.mwater >= i.nwater AND
u.mair >= i.nair AND
u.mearth >= i.nearth AND
u.mlight >= i.nlight AND
u.mgray >= i.ngray AND
u.mdark >= i.ndark AND
i.setsale = 0 AND
u.id = {$user['id']};")) {
`i`.`needident` = 0 AND
`i`.`id` = ?i AND
`i`.`duration` < `i`.`maxdur` AND
`i`.`owner` = ?i AND
`u`.`sila` >= `i`.`nsila` AND
`u`.`lovk` >= `i`.`nlovk` AND
`u`.`inta` >= `i`.`ninta` AND
`u`.`vinos` >= `i`.`nvinos` AND
`u`.`intel` >= `i`.`nintel` AND
`u`.`mudra` >= `i`.`nmudra` AND
`u`.`level` >= `i`.`nlevel` AND
(?i OR (?i = `i`.`nalign`) or (`i`.`nalign` = 0)) AND
`u`.`noj` >= `i`.`nnoj` AND
`u`.`topor` >= `i`.`ntopor` AND
`u`.`dubina` >= `i`.`ndubina` AND
`u`.`mec` >= `i`.`nmech` AND
`u`.`mfire` >= `i`.`nfire` AND
`u`.`mwater` >= `i`.`nwater` AND
`u`.`mair` >= `i`.`nair` AND
`u`.`mearth` >= `i`.`nearth` AND
`u`.`mlight` >= `i`.`nlight` AND
`u`.`mgray` >= `i`.`ngray` AND
`u`.`mdark` >= `i`.`ndark` AND
`i`.`setsale` = 0 AND
`u`.`id` = ?i",$id,$user['id'],$al,$user['align'],$user['id'])) {
$dd = $dd->fetch_row();
if ($dd[0] > 0) {
return true;