Free hunt: only spawn ghosts that have an uploaded video

Add `AND webm_path IS NOT NULL` to the /api/freehunt pool so free-hunt
mode only selects ghosts with real media (and their derived webp/image
fallbacks), never bare procedural-wisp ghosts.
This commit is contained in:
2026-06-22 10:37:52 +10:00
parent 653980a52e
commit efadc85195
+3 -1
View File
@@ -75,7 +75,9 @@ router.get('/scan/:code', (req, res) => {
router.get('/freehunt', (req, res) => { router.get('/freehunt', (req, res) => {
const n = Math.min(parseInt(req.query.n, 10) || 3, 10); const n = Math.min(parseInt(req.query.n, 10) || 3, 10);
const type = req.query.type; // optional red|yellow|blue filter const type = req.query.type; // optional red|yellow|blue filter
let q = 'SELECT * FROM ghosts WHERE enabled = 1 AND is_boss = 0'; // Free hunt only spawns ghosts with an uploaded video (webm); the webp/image
// fallbacks are derived from it, so these always render on every platform.
let q = 'SELECT * FROM ghosts WHERE enabled = 1 AND is_boss = 0 AND webm_path IS NOT NULL';
const params = []; const params = [];
if (type && ['red', 'yellow', 'blue'].includes(type)) { if (type && ['red', 'yellow', 'blue'].includes(type)) {
q += ' AND type = ?'; q += ' AND type = ?';