Skip to content

Commit

Permalink
add support for vehicles
Browse files Browse the repository at this point in the history
  • Loading branch information
ExtraJuiceMan committed May 5, 2018
1 parent ead78a9 commit aa9a2a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions RealEstate/Overrides/SimulateBarricadeOverride.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ internal static bool Prefix(UseableBarricade __instance, uint simulation, bool i

if (GetValue<bool>(__instance, "isUsing", BindingFlags.NonPublic | BindingFlags.Instance))
{
if (GetValue<InteractableVehicle>(__instance, "parentVehicle", BindingFlags.NonPublic | BindingFlags.Instance) != null && RealEstate.instance.Configuration.Instance.enableBuildingOnVehicles)
return true;

House house = RealEstate.manager.HouseFromPosition(GetValue<Vector3>(__instance, "point", BindingFlags.NonPublic | BindingFlags.Instance));

if (house == null && RealEstate.instance.Configuration.Instance.disableBuildingIfNotInHome)
Expand Down
2 changes: 2 additions & 0 deletions RealEstate/RealEstateConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class RealEstateConfiguration : IRocketPluginConfiguration
public int feePaymentTimeInMinutes;
public bool destroyStructuresOnEviction;
public bool disableBuildingIfNotInHome;
public bool enableBuildingOnVehicles;
public List<House> homes;
public List<DisplayName> displayNames;

Expand All @@ -26,6 +27,7 @@ public void LoadDefaults()
feePaymentTimeInMinutes = 1440;
destroyStructuresOnEviction = false;
disableBuildingIfNotInHome = false;
enableBuildingOnVehicles = false;

homes = new List<House>();
displayNames = new List<DisplayName>();
Expand Down

0 comments on commit aa9a2a4

Please sign in to comment.