Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correctly split up the PUGSETUP_DAMAGEPRINT_CVARS #37

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

paulo-erichsen
Copy link

The previous code would split on spaces causing variables that contained spaces to not be set correctly.

Fixed that code to correctly split the CVARS into the appropriate variables. Also make sure to escape slashes in values to allow sed to properly replace slashes.

Example of CVAR that now works:

PUGSETUP_DAMAGEPRINT_CVARS="sm_pugsetup_damageprint_auto_color=0,sm_pugsetup_damageprint_format= {GREEN}To: [{DMG_TO} / {HITS_TO} hits] From: [{DMG_FROM} / {HITS_FROM} hits] - {NAME} ({HEALTH} hp)"

The above should set /server/csgo/cfg/sourcemod/pugsetup/pugsetup_damageprint.cfg to

sm_pugsetup_damageprint_auto_color "0"
sm_pugsetup_damageprint_format " {GREEN}To: [{DMG_TO} / {HITS_TO} hits] From: [{DMG_FROM} / {HITS_FROM} hits] - {NAME} ({HEALTH} hp)"

@timche could you test this change before merging it? I've only tested on a separate script when I modified it directly. I didn't test on the actual docker image

The previous code would split on spaces causing variables that
contained spaces to not be set correctly.

Fixed that code to correctly split the CVARS into the appropriate
variables. Also make sure to escape slashes in values to allow sed to
properly replace slashes.

Example of CVAR that now works:

```
PUGSETUP_DAMAGEPRINT_CVARS="sm_pugsetup_damageprint_auto_color=0,sm_pugsetup_damageprint_format= {GREEN}To: [{DMG_TO} / {HITS_TO} hits] From: [{DMG_FROM} / {HITS_FROM} hits] - {NAME} ({HEALTH} hp)"
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant