Skip to content
This repository has been archived by the owner on Dec 21, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant