Skip to content
This repository was archived by the owner on Feb 6, 2025. It is now read-only.

correctly split up the PUGSETUP_DAMAGEPRINT_CVARS #37

Closed
wants to merge 1 commit into from
Closed

correctly split up the PUGSETUP_DAMAGEPRINT_CVARS #37

wants to merge 1 commit into 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)"
```
@paulo-erichsen paulo-erichsen closed this by deleting the head repository Mar 25, 2025
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