Fix spectator issue

This commit is contained in:
2025-07-08 22:48:39 +03:00
parent af9a5f6548
commit d4a2557ca2
3 changed files with 30 additions and 29 deletions

View File

@ -10,15 +10,9 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="7a23d6a2-8a03-45c3-b4f4-ba70e6386a3d" name="Changes" comment=""> <list default="true" id="7a23d6a2-8a03-45c3-b4f4-ba70e6386a3d" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/GearToLife/GearToLife/ModConfig.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.idea.GearToLife/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.GearToLife/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/.idea.GearToLife/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.GearToLife/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/GearToLife.sln.DotSettings.user" beforeDir="false" afterPath="$PROJECT_DIR$/GearToLife.sln.DotSettings.user" afterDir="false" />
<change beforePath="$PROJECT_DIR$/GearToLife/GearToLife/GearToLife.csproj" beforeDir="false" afterPath="$PROJECT_DIR$/GearToLife/GearToLife/GearToLife.csproj" afterDir="false" />
<change beforePath="$PROJECT_DIR$/GearToLife/GearToLife/GearToLifeModSystem.cs" beforeDir="false" afterPath="$PROJECT_DIR$/GearToLife/GearToLife/GearToLifeModSystem.cs" afterDir="false" /> <change beforePath="$PROJECT_DIR$/GearToLife/GearToLife/GearToLifeModSystem.cs" beforeDir="false" afterPath="$PROJECT_DIR$/GearToLife/GearToLife/GearToLifeModSystem.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/GearToLife/GearToLife/Patches/KnifePatch.cs" beforeDir="false" afterPath="$PROJECT_DIR$/GearToLife/GearToLife/Patches/TemporalGearPatches.cs" afterDir="false" /> <change beforePath="$PROJECT_DIR$/GearToLife/GearToLife/Patches/TemporalGearPatches.cs" beforeDir="false" afterPath="$PROJECT_DIR$/GearToLife/GearToLife/Patches/TemporalGearPatches.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/GearToLife/GearToLife/assets/geartolife/lang/en.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/GearToLife/GearToLife/modicon.png" beforeDir="false" afterPath="$PROJECT_DIR$/GearToLife/GearToLife/modicon.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/GearToLife/GearToLife/modinfo.json" beforeDir="false" afterPath="$PROJECT_DIR$/GearToLife/GearToLife/modinfo.json" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -34,6 +28,7 @@
<component name="HighlightingSettingsPerFile"> <component name="HighlightingSettingsPerFile">
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/0c42f62c19174521b2d3845ff1c760a82400/7e/d3044f89/ItemTemporalGearPatches.cs" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/0c42f62c19174521b2d3845ff1c760a82400/7e/d3044f89/ItemTemporalGearPatches.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/0c42f62c19174521b2d3845ff1c760a82400/80/2430a869/TemporalLifeModSystem.cs" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/0c42f62c19174521b2d3845ff1c760a82400/80/2430a869/TemporalLifeModSystem.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/185df8fd8a7e41f3aa8086976f138a921db000/4d/70c8b96d/IServerPlayer.cs" root0="SKIP_HIGHLIGHTING" />
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/185df8fd8a7e41f3aa8086976f138a921db000/59/b0654600/EnumAppSide.cs" root0="SKIP_HIGHLIGHTING" /> <setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/185df8fd8a7e41f3aa8086976f138a921db000/59/b0654600/EnumAppSide.cs" root0="SKIP_HIGHLIGHTING" />
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/185df8fd8a7e41f3aa8086976f138a921db000/b4/8111d97a/ModSystem.cs" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/185df8fd8a7e41f3aa8086976f138a921db000/b4/8111d97a/ModSystem.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/185df8fd8a7e41f3aa8086976f138a921db000/c7/55ed9fec/EnumChatType.cs" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/185df8fd8a7e41f3aa8086976f138a921db000/c7/55ed9fec/EnumChatType.cs" root0="FORCE_HIGHLIGHTING" />
@ -48,26 +43,26 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
".NET Launch Settings Profile.GearToLife: Client.executor": "Run", &quot;.NET Launch Settings Profile.GearToLife: Client.executor&quot;: &quot;Run&quot;,
".NET Launch Settings Profile.GearToLife: Server.executor": "Run", &quot;.NET Launch Settings Profile.GearToLife: Server.executor&quot;: &quot;Run&quot;,
".NET Project.CakeBuild.executor": "Run", &quot;.NET Project.CakeBuild.executor&quot;: &quot;Run&quot;,
"ModuleVcsDetector.initialDetectionPerformed": "true", &quot;ModuleVcsDetector.initialDetectionPerformed&quot;: &quot;true&quot;,
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager": "true", &quot;RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager&quot;: &quot;true&quot;,
"RunOnceActivity.git.unshallow": "true", &quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
"git-widget-placeholder": "master", &quot;git-widget-placeholder&quot;: &quot;master&quot;,
"node.js.detected.package.eslint": "true", &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
"node.js.detected.package.tslint": "true", &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
"node.js.selected.package.eslint": "(autodetect)", &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
"node.js.selected.package.tslint": "(autodetect)", &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
"nodejs_package_manager_path": "npm", &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
"settings.editor.selected.configurable": "dotNetConsole", &quot;settings.editor.selected.configurable&quot;: &quot;dotNetConsole&quot;,
"vue.rearranger.settings.migration": "true" &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
} }
}]]></component> }</component>
<component name="RunManager" selected=".NET Project.CakeBuild"> <component name="RunManager" selected=".NET Launch Settings Profile.GearToLife: Client">
<configuration name="CakeBuild" type="DotNetProject" factoryName=".NET Project"> <configuration name="CakeBuild" type="DotNetProject" factoryName=".NET Project">
<option name="EXE_PATH" value="" /> <option name="EXE_PATH" value="" />
<option name="PROGRAM_PARAMETERS" value="" /> <option name="PROGRAM_PARAMETERS" value="" />
@ -134,7 +129,10 @@
<workItem from="1751129068738" duration="12452000" /> <workItem from="1751129068738" duration="12452000" />
<workItem from="1751184684862" duration="604000" /> <workItem from="1751184684862" duration="604000" />
<workItem from="1751194709803" duration="1551000" /> <workItem from="1751194709803" duration="1551000" />
<workItem from="1751723280140" duration="17500000" /> <workItem from="1751723280140" duration="19501000" />
<workItem from="1751804540358" duration="2112000" />
<workItem from="1751808744287" duration="6498000" />
<workItem from="1752003269468" duration="688000" />
</task> </task>
<task id="LOCAL-00001" summary="Catch gear break event"> <task id="LOCAL-00001" summary="Catch gear break event">
<option name="closed" value="true" /> <option name="closed" value="true" />

View File

@ -104,6 +104,9 @@ public class GearToLifeModSystem : ModSystem
if (GetLives(player) > 0) return; if (GetLives(player) > 0) return;
player.WorldData.CurrentGameMode = EnumGameMode.Spectator; player.WorldData.CurrentGameMode = EnumGameMode.Spectator;
player.WorldData.NoClip = true;
player.WorldData.FreeMove = true;
player.BroadcastPlayerData(); player.BroadcastPlayerData();
Notify(player, "geartolife:respawn.spectator", GetLives(player)); Notify(player, "geartolife:respawn.spectator", GetLives(player));
} }

View File

@ -10,7 +10,7 @@ namespace GearToLife.Patches;
[HarmonyPatchCategory("geartolife")] [HarmonyPatchCategory("geartolife")]
internal static class TemporalGearPatches internal static class TemporalGearPatches
{ {
[HarmonyPostfix()] [HarmonyPostfix]
[HarmonyPatch(typeof(ItemTemporalGear), "OnHeldInteractStop")] [HarmonyPatch(typeof(ItemTemporalGear), "OnHeldInteractStop")]
public static void AfterUsingGear(float secondsUsed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel) public static void AfterUsingGear(float secondsUsed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel)
{ {