ValveSoftware / source-sdk-2013

The 2013 edition of the Source SDK
https://developer.valvesoftware.com/wiki/SDK2013_GettingStarted
Other
3.76k stars 2k forks source link

Mistake in vsh_prep.pl in CreateFuncToSetPerlVars #354

Open dtugend opened 8 years ago

dtugend commented 8 years ago

Hello, I am not good at Perl and also I am not sure if vsh_prep.pl is still used.

I think there are mistakes in the function CreateFuncToSetPerlVars in line 242:

Line 254 should be

$out .= ( $dynamicDefineMax[$i] - $dynamicDefineMin[$i] + 1 )." + ".$dynamicDefineMin[$i];

instead of

$out .= ( $dynamicDefineMax[$i] - $dynamicDefineMin[$i] + 1 ) + $dynamicDefineMin[$i];

And Line 261 should be

$out .= ( $staticDefineMax[$i] - $staticDefineMin[$i] + 1 )." + ".$staticDefineMin[$i];

instead of

$out .= ( $staticDefineMax[$i] - $staticDefineMin[$i] + 1 ) + $staticDefineMin[$i];


Basically I think that the calculated combo value will be wrong otherwise if $dynamicDefineMin / $staticDefineMin has values different from 0 in the list!

If someone can confirm this, I'd be happy to submit a pull request with a fix :-)