fix for shoreline

This commit is contained in:
CWX 2022-06-11 22:25:07 +01:00
parent 88e08ecab7
commit 2d787de939
7 changed files with 12 additions and 9 deletions

View File

@ -4,8 +4,8 @@ Copyright (c) [year] [fullname]. All rights reserved.
Developed by: Developed by:
[CWX] [CWX]
[https://github.com/CWXDEV/CWX-DeSharpener] [https://dev.sp-tarkov.com/CWX/CWX-BushWhacker]
[https://hub.sp-tarkov.com/files/file/455-cwx-desharpener/] [https://hub.sp-tarkov.com/files/file/519-cwx-masterkey/]
Permission is hereby granted, free of charge, to any person Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files obtaining a copy of this software and associated documentation files

View File

@ -1,9 +1,9 @@
{ {
"name": "BUSHWHACKER", "name": "BUSHWHACKER",
"author": "CWX", "author": "CWX",
"version": "1.1.0", "version": "1.0.1",
"license": "NCSA", "license": "NCSA",
"main": "package.js", "main": "package.js",
"akiVersion": "3.0.0" "akiVersion": "2.3.1"
} }

View File

@ -11,10 +11,10 @@ namespace BushWhacker
{ {
return typeof(GameWorld).GetMethod("OnGameStarted", BindingFlags.Public | BindingFlags.Instance); return typeof(GameWorld).GetMethod("OnGameStarted", BindingFlags.Public | BindingFlags.Instance);
} }
[PatchPostfix] [PatchPostfix]
public static void PatchPostFix() public static void PatchPostFix()
{ {
Debug.LogError("test patch");
BushWhacker.DisableBushes(); BushWhacker.DisableBushes();
} }
} }

View File

@ -17,13 +17,16 @@ namespace BushWhacker
public static void DisableBushes() public static void DisableBushes()
{ {
var gameWorld = Singleton<GameWorld>.Instance; var bushes = FindObjectsOfType<ObstacleCollider>().ToList();
var bushes = GameObject.FindObjectsOfType<ObstacleCollider>().ToList(); Debug.LogError(bushes.Count);
foreach (var bushesItem in bushes) foreach (var bushesItem in bushes)
{ {
if (bushesItem.transform.parent.gameObject.name.Contains("filbert") || bushesItem.transform.parent.gameObject.name.Contains("fibert")) Debug.LogError("1");
var filbert = bushesItem?.transform?.parent?.gameObject?.name?.Contains("filbert");
var fibert = bushesItem?.transform?.parent?.gameObject?.name?.Contains("fibert");
if (filbert == true || fibert == true)
{ {
Object.DestroyImmediate(bushesItem); DestroyImmediate(bushesItem);
} }
} }
} }