Conversation
|
how to fix russian letters not typing? sometimes they work with capslock??? |
Ошибка в коде, там чуть чуть с юникодом проблема, а русские символы далековато в нем, в малум меню мультилингуал есть исправление: |
|
@Limehcik а у тебя нет случаем готовой длл с фиксом? |
Я делал полный переврд сикоменю поэтому разбираюсь, я могу собрать фикс ошибки и выложить, в течении недели сделаю(изза проблем с интернетом я могу пользоваться только 2g(Ешка)) |
Буду ждать) |
|
@Limehcik Ну что там с фиксом? |
Я седня зашел и кароч, все сделал но собрать не могу, зависимости для него не качаются без впн, впн есть рабочий только для браузера, я их скачал, но прога не в какую их не принимает и пытается скачать, я бился несколько часов, может еще буду искать решение, но врятли |
This comment has been minimized.
This comment has been minimized.
@Limehcik попробуй Vpnly, на германии всё работает и впн бесплатный, правда регион выбрать нельзя там на удачу включать и выключать надо |
This comment has been minimized.
This comment has been minimized.
|
@fiszfasznasz if you are still interested in having this merged, I would like to request some changes:
|
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
|
lets see what copilot thinks just for fun |
This comment was marked as off-topic.
This comment was marked as off-topic.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 14 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/Cheats/NotificationHandler.cs
Outdated
| if (!CheatToggles.notifyOnDeath || killer == null || target == null) return; | ||
|
|
||
| var (realKillerName, displayKillerName, isDisguised) = GetPlayerIdentity(killer); | ||
| string targetName = $"<color=#{ColorUtility.ToHtmlStringRGB(target.Data.Color)}>{target.CurrentOutfit.PlayerName}</color>"; |
There was a problem hiding this comment.
Potential NullReferenceException on line 80. Similar to line 58, after checking if target is null on line 77, the code accesses target.Data.Color and target.CurrentOutfit.PlayerName without verifying that target.Data and target.CurrentOutfit are not null. These should be checked before access to prevent potential exceptions.
src/Utilities/Utils.cs
Outdated
| // ================================================================== | ||
| // [FIX 2] Replaced the body of murderPlayer. | ||
| // This now uses the game's standard method, which will be intercepted | ||
| // by your PlayerControl_CmdCheckMurder patch. This is the correct and | ||
| // more stable way to implement host-powered kills. | ||
| public static void murderPlayer(PlayerControl target, MurderResultFlags result) | ||
| { | ||
| if (isFreePlay){ | ||
| if (target == null) return; | ||
|
|
||
| PlayerControl.LocalPlayer.MurderPlayer(target, MurderResultFlags.Succeeded); | ||
| return; | ||
|
|
||
| } | ||
|
|
||
| foreach (var item in PlayerControl.AllPlayerControls) | ||
| { | ||
| MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)RpcCalls.MurderPlayer, SendOption.None, AmongUsClient.Instance.GetClientIdFromCharacter(item)); | ||
| writer.WriteNetObject(target); | ||
| writer.Write((int)result); | ||
| AmongUsClient.Instance.FinishRpcImmediately(writer); | ||
| } | ||
| PlayerControl.LocalPlayer.MurderPlayer(target, result); | ||
| } | ||
| // ================================================================== |
There was a problem hiding this comment.
The comment block with "[FIX 2]" and separator lines appears to be temporary development documentation that should be cleaned up before merging. Consider replacing this with a standard documentation comment that explains the purpose and behavior of the murderPlayer method without referencing specific fixes or patch implementations.
src/Patches/OtherPatches.cs
Outdated
| GameData_RemovePlayer_Patch.ClearNotifiedDisconnects(); | ||
|
|
||
| // Clear the set of notified killed victims when a game ends. | ||
| PlayerControl_MurderPlayer_Patch.ClearNotifiedKilledVictims(); |
There was a problem hiding this comment.
The OnGameEnd cleanup is missing a call to clear the vent tracking states. The PlayerPhysics_LateUpdate.ClearAllStates method should be called here to clear the wasInVent and lastKnownPositions dictionaries when the game ends. Without this, state from a previous game could persist into the next game, potentially causing incorrect notifications or memory leaks across multiple game sessions.
| PlayerControl_MurderPlayer_Patch.ClearNotifiedKilledVictims(); | |
| PlayerControl_MurderPlayer_Patch.ClearNotifiedKilledVictims(); | |
| // Clear vent tracking state (wasInVent, lastKnownPositions) when a game ends. | |
| PlayerPhysics_LateUpdate.ClearAllStates(); |
src/Patches/PlayerPhysicsPatches.cs
Outdated
|
|
||
| if (wasInVent.TryGetValue(playerId, out bool previouslyInVent) && currentlyInVent != previouslyInVent) | ||
| { | ||
| Vector2 positionToCheck = currentlyInVent ? lastKnownPositions[playerId] : __instance.myPlayer.GetTruePosition(); |
There was a problem hiding this comment.
There's a potential KeyNotFoundException on line 37. When a player enters a vent for the first time (when currentlyInVent is true and previouslyInVent is false), the code tries to access lastKnownPositions[playerId], but this key may not exist yet if the player's state was just initialized. The code should check if the key exists in lastKnownPositions before accessing it, or use TryGetValue with a fallback position.
| Vector2 positionToCheck = currentlyInVent ? lastKnownPositions[playerId] : __instance.myPlayer.GetTruePosition(); | |
| Vector2 positionToCheck; | |
| if (currentlyInVent) | |
| { | |
| if (!lastKnownPositions.TryGetValue(playerId, out positionToCheck)) | |
| { | |
| positionToCheck = __instance.myPlayer.GetTruePosition(); | |
| } | |
| } | |
| else | |
| { | |
| positionToCheck = __instance.myPlayer.GetTruePosition(); | |
| } |
src/Cheats/NotificationHandler.cs
Outdated
| // Get the displayed (current outfit) name and color | ||
| string displayName = $"<color=#{ColorUtility.ToHtmlStringRGB(Palette.PlayerColors[player.CurrentOutfit.ColorId])}>{player.CurrentOutfit.PlayerName}</color>"; | ||
|
|
There was a problem hiding this comment.
Potential IndexOutOfRangeException on line 42. The code accesses Palette.PlayerColors array using player.CurrentOutfit.ColorId without bounds checking. If ColorId is out of range (due to mods or data corruption), this will throw an exception. Consider adding bounds checking or using TryGetValue pattern to safely access the array.
| // Get the displayed (current outfit) name and color | |
| string displayName = $"<color=#{ColorUtility.ToHtmlStringRGB(Palette.PlayerColors[player.CurrentOutfit.ColorId])}>{player.CurrentOutfit.PlayerName}</color>"; | |
| // Get the displayed (current outfit) name and color, guarding against invalid ColorId values | |
| var playerColors = Palette.PlayerColors; | |
| int colorId = player.CurrentOutfit.ColorId; | |
| Color displayColor; | |
| if (playerColors != null && colorId >= 0 && colorId < playerColors.Length) | |
| { | |
| displayColor = playerColors[colorId]; | |
| } | |
| else | |
| { | |
| // Fallback to the player's real color if the current outfit color is invalid | |
| displayColor = player.Data.Color; | |
| } | |
| string displayName = $"<color=#{ColorUtility.ToHtmlStringRGB(displayColor)}>{player.CurrentOutfit.PlayerName}</color>"; |
src/Patches/PlayerPhysicsPatches.cs
Outdated
| foreach(GameObject bodyObject in bodyObjects) | ||
| { | ||
| DeadBody deadBody = bodyObject.GetComponent<DeadBody>(); | ||
|
|
||
| if (deadBody){ | ||
| if (!deadBody.Reported){ // Only draw tracers for unreported dead bodies | ||
| TracersHandler.drawBodyTracer(deadBody); | ||
| } | ||
| if (deadBody && !deadBody.Reported) | ||
| { | ||
| TracersHandler.drawBodyTracer(deadBody); | ||
| } | ||
| } |
There was a problem hiding this comment.
This foreach loop immediately maps its iteration variable to another variable - consider mapping the sequence explicitly using '.Select(...)'.
src/MalumMenu.cs
Outdated
| Harmony.PatchAll(); | ||
|
|
||
| menuUI = AddComponent<MenuUI>(); | ||
| notificationUI = AddComponent<NotificationUI>(); |
There was a problem hiding this comment.
Write to static field from instance method, property, or constructor.
src/Cheats/NotificationHandler.cs
Outdated
| if (isDisguised) | ||
| { | ||
| message = $"{realKillerName} (as {displayKillerName}) killed {victimName} in {roomName}."; | ||
| } | ||
| else | ||
| { | ||
| message = $"{realKillerName} killed {victimName} in {roomName}."; | ||
| } |
There was a problem hiding this comment.
Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
src/Cheats/NotificationHandler.cs
Outdated
| if (isDisguised) | ||
| { | ||
| message = $"{realKillerName} (as {displayKillerName}) tried to kill {targetName} in {roomName}. (Saved)"; | ||
| } | ||
| else | ||
| { | ||
| message = $"{realKillerName} tried to kill {targetName} in {roomName}. (Saved)"; | ||
| } |
There was a problem hiding this comment.
Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
src/Cheats/NotificationHandler.cs
Outdated
| if (isDisguised) | ||
| { | ||
| message = $"{realPlayerName} (as {displayPlayerName}) has {action} a vent in {roomName}."; | ||
| } | ||
| else | ||
| { | ||
| message = $"{realPlayerName} has {action} a vent in {roomName}."; | ||
| } |
There was a problem hiding this comment.
Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
This reverts commit d2c3b77.
|
I'm now rewriting this to use the existing ConsoleUI and maybe add some more events to log. |
👍 |
|
My guesses are: |
No description provided.