gta3sc icon indicating copy to clipboard operation
gta3sc copied to clipboard

String Constant Conflicts

Open thelink2012 opened this issue 7 years ago • 5 comments

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!

thelink2012 avatar Nov 06 '16 04:11 thelink2012

Commit 4b1684b is not a fix, just a quick workaround for working with the Vice City SCM.

thelink2012 avatar Nov 06 '16 04:11 thelink2012

Since #63, we should exclude the object models enum from the search.

thelink2012 avatar Nov 06 '16 23:11 thelink2012

CONSTANT arguments admit integer literals.

thelink2012 avatar Nov 07 '16 16:11 thelink2012

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.

thelink2012 avatar Dec 10 '16 20:12 thelink2012

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

thelink2012 avatar Dec 12 '16 04:12 thelink2012