fix: fool's artefact caching returns non-fool artefact data

#313
This commit is contained in:
Martin Ambrus
2017-11-25 20:50:12 +01:00
parent 8d8c96014b
commit 5dfbd89130
3 changed files with 233 additions and 184 deletions
+12 -1
View File
@@ -7085,7 +7085,18 @@ References: User ID/Message ID, Mode
self::$foolArtefactCache[$vid] = [];
}
return (isset(self::$foolArtefactCache[$vid][$type.$uid]) ? self::$foolArtefactCache[$vid][$type.$uid] : []);
if (
isset(self::$foolArtefactCache[$vid][$type.$uid]) &&
self::$foolArtefactCache[$vid][$type.$uid]['type'] == 8 &&
self::$foolArtefactCache[$vid][$type.$uid]['kind'] == $type &&
self::$foolArtefactCache[$vid][$type.$uid]['owner'] == $uid &&
self::$foolArtefactCache[$vid][$type.$uid]['size'] > 1 &&
self::$foolArtefactCache[$vid][$type.$uid]['active'] > 1
) {
return self::$foolArtefactCache[$vid][$type.$uid];
} else {
return [];
}
}
function claimArtefact($vref, $ovref, $id) {