Repository navigation
Hold players still while the WASD menu is open - #18
xiaoyueyoqwq wants to merge 2 commits into
Conversation
|
Wait a sec, I forget to sync the branch :/ |
VelocityModifier on PlayerPawn did not stop movement: possessed bots kept walking, and humans lurched forward then snapped back. Freeze the occupied pawn in PreEntityThink instead, restyle the cursor, and cap the overlay at five rows so the footer is not clipped.
bc3fb90 to
8ba6d5a
Compare
|
Rebased onto current |
Keeping the menu open pinned origin every think and overwrote the engine spawn teleport, so a player could stay off team spawn.
|
Thanks for the work, but I can't take this one as it is. It bundles a new freeze, a new input model, a key remap, an overlay restyle, the menu during bot takeover and a version bump, and a few parts are a step back:
If you can show the forward lurch or the clipped footer on main (a clip and your resolution help), open an issue or a small PR for just that and I will look at it. |
Got it. I’ll answer the remaining questions later. Regarding your question about why the menu automatically closes after a round ends, there are actually two separate reasons that became mixed together during my testing. Originally, I was trying to fix a menu issue where a player controlling a bot could still move the pawn with W/S while navigating the menu. Because of "FakePlayer", the normal "isBot" check did not work for the pawn I was dealing with, which led me to add the detection/freezing logic. However, you are correct that AstraSkin already has its own bot detection and prevents players from opening the menu while controlling a bot. I apparently overlooked that during testing and conflated this with the menu-freezing issue. I’ll revert that part of the change. While testing, though, I found a separate problem: if the menu remained open across a round transition, the excessive frame freezing could leave the player in a strange state where the normal round-end teleport back to spawn did not take effect correctly. That is why I added the automatic menu close at the end of each round. Interestingly, this also fixed several HUD lifecycle issues. For example, if the menu HUD was left open, it could continue flashing near the bottom-center of the screen during the team display phase, or overlap/flash together with the “Start Action” indicator after the round ended. So the current plan is to remove the unnecessary bot-control changes, but keep the round-end auto-close, since that behavior addresses a separate lifecycle issue and also prevents several HUD conflicts. |
|
Withdrawing this PR. The freeze, input path, key remap, overlay restyle, menu-during-takeover, and version bump are not going upstream. Those mixed a BotManager case (menu while possessing) into Astra, which already blocks that with Round-end close is a separate HUD lifecycle change (team intro / freeze-end prompt). Opened as #19 |
Problem
Opening the WASD menu still let the pawn move.
The old hold wrote
VelocityModifieron the humanPlayerPawnduring OnTick. That is too late: bot takeover applies the occupant's usercmd to the occupied body before OnTick, so a possessed bot kept walking around the map. Humans got a smaller version of the same thing — a visible lurch forward, then a snap back.The overlay also painted six rows plus a footer. CS2's center HTML clips through that last line, so the key hints were cut in half.
Leaving the menu open also pinned origin every think. That overwrite covered the engine spawn teleport, so a player who kept the menu open through round end stayed off team spawn.
Change
Hold the pawn that is actually being driven (the bot body while possessing, otherwise the player):
OnServerPreEntityThinksetsMOVETYPE_NONEand pins originClose the menu on
round_prestart(everyone) andplayer_spawnPre (that player), so the origin pin is lifted before spawn teleport.The menu itself is unchanged in what it does (skins, rarity colors, equipped marks, stickers, charms, Default rows). The chrome is cleaner:
►[ ]◄on the selected row, A to go back, R to close, and five visible rows so the footer stays fully on screen. The menu can be opened while possessing a bot.Rebased onto current
main(1.2.0 / #17). Version bump is1.2.2.Scope
mainare keptApplyPlayerCosmeticsOnBotTakeoverare unchangedValidation
dotnet build -c Release: 0 warnings, 0 errors