Browse Source

Fix: Only apply name prefix to 'anywhere' monsters

Location-specific monsters (like grocery-only spawns) don't need
the "Cart Wranglin'" prefix since they're already themed for that
location. The prefix now only applies to monsters that can spawn
anywhere but happen to be near a special location.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
master
HikeMap User 4 weeks ago
parent
commit
786d1c0792
  1. 22
      index.html

22
index.html

@ -13477,15 +13477,19 @@
}; };
// Check if spawning near a special location and set name prefix // Check if spawning near a special location and set name prefix
const spawnPos = L.latLng(monster.position.lat, monster.position.lng);
for (const cache of geocaches) {
// Use tags if available, fall back to icon check for backwards compatibility
const isGrocery = (cache.tags && cache.tags.includes('grocery')) || cache.icon === 'cart';
if (isGrocery) {
const dist = spawnPos.distanceTo(L.latLng(cache.lat, cache.lng));
if (dist <= 400) {
monster.namePrefix = "Cart Wranglin' ";
break;
// Only apply prefix to "anywhere" monsters - location-specific monsters don't need it
const monsterSpawnLoc = monsterType.spawnLocation || 'anywhere';
if (monsterSpawnLoc === 'anywhere') {
const spawnPos = L.latLng(monster.position.lat, monster.position.lng);
for (const cache of geocaches) {
// Use tags if available, fall back to icon check for backwards compatibility
const isGrocery = (cache.tags && cache.tags.includes('grocery')) || cache.icon === 'cart';
if (isGrocery) {
const dist = spawnPos.distanceTo(L.latLng(cache.lat, cache.lng));
if (dist <= 400) {
monster.namePrefix = "Cart Wranglin' ";
break;
}
} }
} }
} }

Loading…
Cancel
Save