Skip to content

Commit d1bd975

Browse files
committed
Fixed v0.4.4f10 BuildableItems access change
Use reflection to access Property.BuildableItems which changed from public to protected in v0.4.4f10.
1 parent a23a58e commit d1bd975

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

S1API/Property/PropertyWrapper.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
using System.Collections;
12
using System.Collections.Generic;
23
using UnityEngine;
4+
using S1API.Internal.Utils;
35
#if IL2CPPMELON
46
using Il2CppTMPro;
57
using Il2CppScheduleOne.Money;
@@ -166,7 +168,7 @@ public bool IsContentCulled
166168
/// Gets the number of buildable items currently placed in this property.
167169
/// </summary>
168170
public int BuildableItemCount =>
169-
InnerProperty.BuildableItems.Count;
171+
(ReflectionUtils.TryGetFieldOrProperty(InnerProperty, "BuildableItems") as IList)?.Count ?? 0;
170172

171173
/// <summary>
172174
/// Gets the position of the NPC spawn point for this property.

0 commit comments

Comments
 (0)