Skip to content

Call on Entity::clearEmptyKeyvalues upon saving - #157

Draft
Mikk155 wants to merge 1 commit into
wootguy:masterfrom
Mikk155:fix-removal-of-empty-values
Draft

Mikk155 wants to merge 1 commit into
wootguy:masterfrom
Mikk155:fix-removal-of-empty-values

Conversation

@Mikk155

@Mikk155 Mikk155 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Aparently BSPGuy keeps empty values. i've been told this didn't happened on previous versions and to be correct keeping them empy will cause problems.

Most level editors (if not all) automatically strips these empty value pairs.

the engine (svengine at least) doesn't check for empty strings when passing them to the games leading to pev->model being valid but empty which ends with the game setting up a empty model. in worst cases precache error shutting down the server.

@wootguy

wootguy commented Sep 6, 2026

Copy link
Copy Markdown
Owner

I'd rather find the root of problem. What's introducing the empty values? Erasing a value in the attributes tab will delete the key if it's empty. Deleting a value in the raw edit tab won't, and should be allowed if for whatever reason you need an empty value.

@Mikk155

Mikk155 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

As far as i know a guy was using the NewBSPGuy fork in a map and for some reason a lot of values were empty so is not a problem of bspguy on its own, i'm trying to think in a case where a empty value should be used but i can't imagine it, on compiling maps these pairs gets removed if their values are empty. I believe these will cause more problems like i said sven coop not checking if values are empty as-is. Leads to a "valid" model entvar which later on the game sets a empty model

@Mikk155

Mikk155 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

i'm not familiar with the compilers but this may be what i'm refering to: https://github.com/seedee/SDHLT/blob/master/src/sdhlt/common/bspfile.cpp#L1723

@wootguy

wootguy commented Sep 7, 2026

Copy link
Copy Markdown
Owner

In that case I'd rather make a "Delete empty keyvalues" tool or setting for this. It's unlikely someone needs an empty value but it shouldn't be impossible to save one. Mods can interpret values however they want, including giving an empty value a special meaning.

@Mikk155
Mikk155 marked this pull request as draft September 8, 2026 21:36
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.

2 participants