StrataSource / Portal-2-Community-Edition

Task tracker for Portal 2: Community Edition
https://www.portal2communityedition.com
147 stars 3 forks source link

Bug: give_portalgun and its successors cannot be fired via point_client/servercommand with cheats disabled #1005

Open terrifiedoficecream opened 2 years ago

terrifiedoficecream commented 2 years ago

Describe the bug

When give_portalgun, upgrade_portalgun or upgrade_potatogun are executed by a point_client/servercommand with cheats disabled, the console will state that the commands in question cannot be fired with sv_cheats set to 0 and the portalgun will not be given nor upgraded. This breaks backwards compatibility with maps using these commands to give or upgrade the portalgun, even if they're legacy commands.

I suggest keeping these commands cheat-protected, but allowing point_client/servercommand to execute them as to not break older maps made in Portal 2.

Issue Map

Here is an example map with buttons to showcase the issue. https://drive.google.com/file/d/1RJjmnmIjjvPR4X_DerEQd2IPTHKtINob/view?usp=sharing This also occurs on any Portal 2 map that uses point_client/servercommand to give the player a portalgun.

To Reproduce

  1. Open map where the portalgun is given/upgraded using the console commands with sv_cheats set to 0
  2. Look in the console and see it complain about sv_cheats being set to 0 without giving you a portalgun
  3. cry because the map doesnt work

Operating System

No response

TeamSpen210 commented 2 years ago

It's a bit more complicated, these commands should not be firable with cheats disabled actually. The difference is that in singleplayer, most cheat commands can be run regardless of the cheats setting - but in multiplayer, challenge mode, etc they cannot. The problem is that P2CE is based on CSGO, which has the multiplayer restrictions still enabled - that needs to be reverted.

In the Peer Review update, Valve actually changed the transition scripts to use VScript functions instead to allow them to work without cheats on. Maps should be doing that also, and generally not turning on cheats if they can avoid it for this reason.