mirror of
https://github.com/mudabbir-ahmad/MAD-Treasure-Hunt.git
synced 2026-10-08 03:00:20 +00:00
Refactor claim distance and update cache claiming logic in GlobalMapScreen and usePlayerGame
This commit is contained in:
1 parent
1948fb4d90
commit
dc18186265
2 files changed
+7
-5
No files matched your search
@@ -78,6 +78,7 @@ const GlobalMapScreen = ({ navigation, route }) => {
|
||||
claimableCaches,
|
||||
GLOBAL_CLAIM_DISTANCE_METERS,
|
||||
selectedCacheId,
|
||||
false,
|
||||
);
|
||||
|
||||
// Handlers ----------------------------
|
||||
@@ -132,12 +133,11 @@ const GlobalMapScreen = ({ navigation, route }) => {
|
||||
setIsClaiming(false);
|
||||
|
||||
if (result) {
|
||||
const points = Number(claimedCache?.CachePoints ?? 10);
|
||||
const cacheName = claimedCache?.CacheName || "Cache";
|
||||
setFoundCacheIds((prev) =>
|
||||
prev.includes(cacheId) ? prev : [...prev, cacheId],
|
||||
);
|
||||
setClaimedPopupMessage(`${cacheName} claimed! You gained +${points} points.`);
|
||||
setClaimedPopupMessage(`${cacheName} claimed! You gained +10 points.`);
|
||||
setClaimedPopupVisible(true);
|
||||
setTimeout(() => setClaimedPopupVisible(false), 3000);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user