39 {
40
41 if (item.IsRuined() || item.IsSetForDeletion())
42 return;
43
46 {
47 if (
g_Game.ConfigIsExisting(
path +
" baitTypes") &&
g_Game.ConfigIsExisting(
path +
" baitTypeChances"))
48 {
49 CachedObjectsArrays.ARRAY_INT.Clear();
50 CachedObjectsArrays.ARRAY_FLOAT.Clear();
51 g_Game.ConfigGetIntArray(
path +
" baitTypes",CachedObjectsArrays.ARRAY_INT);
52 g_Game.ConfigGetFloatArray(
path +
" baitTypeChances",CachedObjectsArrays.ARRAY_FLOAT);
53 int count = CachedObjectsArrays.ARRAY_INT.Count();
54 if (count == CachedObjectsArrays.ARRAY_FLOAT.Count())
55 {
56 int key;
57 float value;
58 for (int i = 0; i < count; i++)
59 {
60 key = CachedObjectsArrays.ARRAY_INT[i];
63 {
65 }
66 }
67 }
68 else
69 {
70 ErrorEx(
"'baitTypes' and 'baitTypeChances' arrray counts of " + item.GetType() +
" do not match!",
ErrorExSeverity.INFO);
71 }
72 }
73 if (
g_Game.ConfigIsExisting(
path +
" resultQuantityBaseMod"))
75 if (
g_Game.ConfigIsExisting(
path +
" resultQuantityDispersionMin"))
77 if (
g_Game.ConfigIsExisting(
path +
" resultQuantityDispersionMax"))
79 }
80 }
ref map< int, ref BaitData > m_BaitCompatibilityMap
float m_QualityDispersionMinMod
float m_QualityDispersionMaxMod
float AdjustBaitItemChance(EntityAI item)
Allows for adjustment of all catch probabilities from item qualities (damage, qty....