diff --git a/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs b/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs index ac82c5d..e5f2113 100644 --- a/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs +++ b/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs @@ -74,6 +74,7 @@ namespace InfectionFreeZone { public static ConfigEntry buildingDeconstructionResourcesMultiplier; public static ConfigEntry humanMovementSpeedMultiplier; + public static ConfigEntry vehicleMovementSpeedMultiplier; public static ConfigEntry vehicleTrunkCapacityMultiplierDebug; public static ConfigEntry vehicleTrunkCapacityMultiplier; @@ -146,6 +147,7 @@ namespace InfectionFreeZone { humanMovementSpeedMultiplier = Config.Bind("General", "Human Movement Speed Multiplier", 1f); + vehicleMovementSpeedMultiplier = Config.Bind("General", "Vehicle Movement Speed Multiplier", 1f); vehicleTrunkCapacityMultiplierDebug = Config.Bind("General", "Vehicle Trunk Capacity Multiplier Debug", false); @@ -382,15 +384,12 @@ namespace InfectionFreeZone { public static void PostfixCalculateSpeedHuman(Movement __instance, ref float __result) { if (Main.humanMovementSpeedMultiplier.Value <= 0) return; - // Humans are "Human(Clone)", infected are "inf_human(Clone)" - if (__instance.gameObject.name != "Human(Clone)") - return; - - // if (Main.debug.Value) - // Console.WriteLine($"Human movement speed is {__result}"); - __result *= Main.humanMovementSpeedMultiplier.Value; - // if (Main.debug.Value) - // Console.WriteLine($"Human movement speed modified to {__result}"); + // Humans are "Human(Clone)", infected are "inf_human(Clone)" and vehicles are "ve_" + var name = __instance.ToString(); + if (name == "Human(Clone)") + __result *= Main.humanMovementSpeedMultiplier.Value; + if (name.StartsWith("ve_")) + __result *= Main.vehicleMovementSpeedMultiplier.Value; } [HarmonyPostfix]