Black market: elite shop for expensive goods, private sellers, weekly catalog value ~20k
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
61ec91b34d
commit
96d8b7cf3b
7 files changed
+88
-34
No files matched your search
@@ -20,12 +20,15 @@ namespace Decentralized
|
||||
ModHook.OnGenerateCustomerNormal -= OnGenerate;
|
||||
}
|
||||
|
||||
private static readonly System.Collections.Generic.Dictionary<string, long> ValueCache = new System.Collections.Generic.Dictionary<string, long>();
|
||||
|
||||
public static long Value(string id)
|
||||
{
|
||||
if (ValueCache.TryGetValue(id, out var cached)) return cached;
|
||||
var it = ModHelper.SpawnItem(id);
|
||||
if (it == null) return 0;
|
||||
long v = it.GetBaseValue();
|
||||
it.Destroy();
|
||||
long v = 0;
|
||||
if (it != null) { v = it.GetBaseValue(); it.Destroy(); }
|
||||
ValueCache[id] = v;
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user