HarbourMasters / HarbourMasters/Shipwright

Convert `CVAR_*` methods to not use magic strings

Open
#4,085 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
5.4k
Forks
837
Avg merge
1d 9h
Merged PRs (30d)
72

Description

Getting the key for a global variable, like the "Skip text" enhancement, is as easy as calling `CVAR_ENHANCEMENT("SkipText")`, but you have to spell `SkipText` correctly every time. Because it's an arbitrary string, failure to do so results in a bug at runtime instead of a build error.

The methods could be made more robust if they're reconfigured to take in constants instead of arbitrary strings (e.g. enum parameters that fetch associated string values from a dictionary).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.