Example #1
0
        public static void RecalcItemObject(ref Pathea.ItemSystem.ItemObject __result, int pos, ref Pathea.CompoundSystem.CompoundItem __instance)
        {
            if (__result == null || __instance == null)
            {
                return;
            }

            // all this to avoid circular references.
            if (!originalValues.ContainsKey(__instance.Id))
            {
                int[] arr = new int[3];
                arr[0] = -1;
                arr[1] = -1;
                arr[2] = -1;
                originalValues.Add(__instance.Id, arr);
            }

            if (originalValues[__instance.Id][pos] == -1)
            {
                originalValues[__instance.Id][pos] = __result.Number;
            }

            int newnum = ChangeCraftingMaterialNumber(originalValues[__instance.Id][pos]);

            // redo
            if (
                __result.Number != newnum
                )
            {
                __result.DeleteNumber(__result.Number);
                __result.ChangeNumber(newnum);
            }
        }
Example #2
0
 public static void PostfixRequireItem3(ref Pathea.ItemSystem.ItemObject __result, Pathea.CompoundSystem.CompoundItem __instance)
 {
     RecalcItemObject(ref __result, 2, ref __instance);
 }