HammerAddons icon indicating copy to clipboard operation
HammerAddons copied to clipboard

SunSpreadAngle must be capitalized

Open ozxybox opened this issue 1 year ago • 4 comments

It turns out, this keyvalue, SunSpreadAngle, must always be properly capitalized for it to be read by VRAD. By having it lowercase in the FGD, the final result will be a lowercased keyvalue in the entity lump, which VRAD skips over.

https://github.com/TeamSpen210/HammerAddons/blob/47afc57e3ff272ebe75a8277b36514bb0a2f10ef/fgd/point/light/light_environment.fgd#L16 https://github.com/TeamSpen210/HammerAddons/blob/47afc57e3ff272ebe75a8277b36514bb0a2f10ef/fgd/point/light/light_directional.fgd#L11

The variable is read from here: https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/utils/vrad/lightmap.cpp#L1483C1-L1483C64

The case-sensitive strcmp that checks it is here: https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/utils/vrad/lightmap.cpp#L1470C1-L1470C31

ozxybox avatar Aug 10 '24 14:08 ozxybox

That's quite dumb. I think I'll also add a postcompiler transform to adjust the casing as well then, to fix this issue.

TeamSpen210 avatar Aug 11 '24 05:08 TeamSpen210

Related, does HA always emit (or intake when importing) lowercase keyvalue names?

ozxybox avatar Aug 11 '24 15:08 ozxybox

Nah, srctools does lookups case-insensitively, but preserves the casing used when it’s initially set/parsed. I need to revamp this though, currently it’s directly exposed as the keys dict meaning it has to just loop over all the keys each time…

TeamSpen210 avatar Aug 11 '24 17:08 TeamSpen210

Ah okay, thanks! Was wondering as I was futzing around with it the other day

ozxybox avatar Aug 11 '24 19:08 ozxybox