View Issue Details

IDProjectCategoryView StatusLast Update
0004598The Dark ModCodingpublic06.08.2017 11:04
Reporterstgatilov Assigned Tostgatilov  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionSVN 
Target VersionTDM 2.06Fixed in VersionTDM 2.06 
Summary0004598: Initializations like "float var = vec_x;" no longer compile
DescriptionThis code does not compile:
  vector va = $player1.getViewAngles();
  va = anglemod360(va); // normalize the angle vector so each part is 0->360
  float yaw = va_y;
The last line is the reason.
Steps To ReproduceCopy/paste the above snippet e.g. into player::init function in scripts, and start TDM.
Most likely any other place in the compiled code is suitable too.
TagsNo tags attached.

Relationships

related to 0004520 resolvedstgatilov Make savegames of x86 and x64 builds interchangeable 

Activities

stgatilov

stgatilov

06.08.2017 04:39

administrator   ~0009051

The last line is wrong type of initialization, because a component of a vector (like "va_y") has type "vector float", which is not the same as just "float".
This new type "vector float" appeared with x64 branch merge, so it was pulled from dhewm3 repository.
In original Doom3 (and TDM 2.05), components of vectors have type "float".

It seems that such expressions are present only in airship-related code. But there can also be player scripts using this =(
stgatilov

stgatilov

06.08.2017 11:03

administrator   ~0009054

Fixed in SVN revision 7058.

I simply returned the old code back (reverting dhewm3 changes).
It places three float variables "vec_x", "vec_y", "vec_z" one after another, then points the variable "vec" to the same address as "vec_x". This plan works perfectly when sizeof(float) = 4 and offsets of vectors components are: x = 0, y = 4, z = 8. In dhewm3, they had to change it because they made sizeof(float) = 8.

Issue History

Date Modified Username Field Change
06.08.2017 04:38 stgatilov New Issue
06.08.2017 04:38 stgatilov Status new => assigned
06.08.2017 04:38 stgatilov Assigned To => stgatilov
06.08.2017 04:39 stgatilov Note Added: 0009051
06.08.2017 07:59 stgatilov Relationship added related to 0004520
06.08.2017 11:03 stgatilov Note Added: 0009054
06.08.2017 11:04 stgatilov Status assigned => resolved
06.08.2017 11:04 stgatilov Fixed in Version => TDM 2.06
06.08.2017 11:04 stgatilov Resolution open => fixed