Skip to content

Commit

Permalink
Merge pull request #16 from jpw1991/15-projectile-patch
Browse files Browse the repository at this point in the history
4.3.2: strengthen null checking on patch
  • Loading branch information
jpw1991 authored Nov 19, 2023
2 parents 8b5df18 + 19b9e97 commit 608bd24
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ChebsMythicalWeapons/ChebsMythicalWeapons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal class ChebsMythicalWeapons : BaseUnityPlugin
{
public const string PluginGuid = "com.chebgonaz.chebsmythicalweapons";
public const string PluginName = "ChebsMythicalWeapons";
public const string PluginVersion = "4.3.1";
public const string PluginVersion = "4.3.2";

private const string ConfigFileName = PluginGuid + ".cfg";
private static readonly string ConfigFileFullPath = Path.Combine(Paths.ConfigPath, ConfigFileName);
Expand Down
12 changes: 6 additions & 6 deletions ChebsMythicalWeapons/ChebsMythicalWeapons.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -101,22 +101,22 @@
<HintPath>..\..\..\.config\r2modmanPlus-local\Valheim\profiles\cheb-development\BepInEx\core\BepInEx.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\..\..\.config\r2modmanPlus-local\Valheim\profiles\cheb-development\unstripped_corlib\UnityEngine.dll</HintPath>
<HintPath>..\..\..\.local\share\Steam\steamapps\common\Valheim\valheim_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AssetBundleModule">
<HintPath>..\..\..\.config\r2modmanPlus-local\Valheim\profiles\cheb-development\unstripped_corlib\UnityEngine.AssetBundleModule.dll</HintPath>
<HintPath>..\..\..\.local\share\Steam\steamapps\common\Valheim\valheim_Data\Managed\UnityEngine.AssetBundleModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\.config\r2modmanPlus-local\Valheim\profiles\cheb-development\unstripped_corlib\UnityEngine.CoreModule.dll</HintPath>
<HintPath>..\..\..\.local\share\Steam\steamapps\common\Valheim\valheim_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.ParticleSystemModule">
<HintPath>..\..\..\.config\r2modmanPlus-local\Valheim\profiles\cheb-development\unstripped_corlib\UnityEngine.ParticleSystemModule.dll</HintPath>
<HintPath>..\..\..\.local\share\Steam\steamapps\common\Valheim\valheim_Data\Managed\UnityEngine.ParticleSystemModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Physics2DModule">
<HintPath>..\..\..\.config\r2modmanPlus-local\Valheim\profiles\cheb-development\unstripped_corlib\UnityEngine.Physics2DModule.dll</HintPath>
<HintPath>..\..\..\.local\share\Steam\steamapps\common\Valheim\valheim_Data\Managed\UnityEngine.Physics2DModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>..\..\..\.config\r2modmanPlus-local\Valheim\profiles\cheb-development\unstripped_corlib\UnityEngine.PhysicsModule.dll</HintPath>
<HintPath>..\..\..\.local\share\Steam\steamapps\common\Valheim\valheim_Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion ChebsMythicalWeapons/Package/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ChebsMythicalWeapons",
"description": "Adds mythical weapons to Valheim. The weapons are found in special locations; eg. Excalibur must be found somewhere in the world and only someone with 100 sword skill can remove it from the stone and use it.",
"version_number": "4.3.1",
"version_number": "4.3.2",
"website_url": "https://github.com/jpw1991/chebs-mythical-weapons",
"dependencies": [
"ValheimModding-Jotunn-2.11.2"
Expand Down
5 changes: 3 additions & 2 deletions ChebsMythicalWeapons/Patches/AttackPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ public class AttackPatches
static void FireProjectileBurst(Attack __instance)
{
// eliminate projectile gravity if configured to do so
var lastProjectile = __instance.m_weapon.m_lastProjectile;
var lastProjectile = __instance?.m_weapon?.m_lastProjectile;
if (lastProjectile == null) return;

if (__instance.m_weapon.m_dropPrefab.name.Equals(ChebsMythicalWeapons.ApolloBow.ItemName))
var dropPrefab = __instance.m_weapon?.m_dropPrefab;
if (dropPrefab != null && dropPrefab.name.Equals(ChebsMythicalWeapons.ApolloBow.ItemName))
{
lastProjectile.GetComponent<Projectile>().m_gravity = ApolloBowItem.ProjectileGravity.Value;
}
Expand Down
4 changes: 2 additions & 2 deletions ChebsMythicalWeapons/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.3.1.0")]
[assembly: AssemblyFileVersion("4.3.1.0")]
[assembly: AssemblyVersion("4.3.2.0")]
[assembly: AssemblyFileVersion("4.3.2.0")]

0 comments on commit 608bd24

Please sign in to comment.