From efadc851957e22c3593458d0f41d6350f194c86a Mon Sep 17 00:00:00 2001 From: jessikitty Date: Mon, 22 Jun 2026 10:37:52 +1000 Subject: [PATCH] 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. --- routes/api.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/routes/api.js b/routes/api.js index 7de0cd4..c0fc045 100644 --- a/routes/api.js +++ b/routes/api.js @@ -75,7 +75,9 @@ router.get('/scan/:code', (req, res) => { router.get('/freehunt', (req, res) => { const n = Math.min(parseInt(req.query.n, 10) || 3, 10); 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 = []; if (type && ['red', 'yellow', 'blue'].includes(type)) { q += ' AND type = ?';