gta3sc
gta3sc copied to clipboard
String Constant Conflicts
String constants may have collisions. For instance, the CAMMODE
enumeration contains a SNIPER
constant, same name of a CARPEDMODEL
constant.
The implication of this is that the following may generate different output depending on how we evaluate the search for a constant:
VAR_INT x
x = SNIPER
In fact, this ends up using CARPEDMODEL
in miss2, while it uses the CAMMODE
enum here.
Specify the evaluation order of enumerations!
Commit 4b1684b is not a fix, just a quick workaround for working with the Vice City SCM.
Since #63, we should exclude the object models enum from the search.
CONSTANT
arguments admit integer literals.
Remark:
III Source Code have variables which collides with level models, and level models have priority over variables when used in a MODEL
argument. Meanwhile, the miss2
we know doesn't allow variable with the same name as string constants (!??).
Plus, we perform this check here which I don't feel is right.
After adding constant collision checks, the gta3 source code no longer compiles, which means they had no such check on the compiler of the first chapter: https://travis-ci.org/thelink2012/gta3sc/jobs/183137213