Fix up Object packet for UF / RoF / RoF2. SolidType was incorrect as those fields are the XY tilt for the object. Need database values for these fields so they will actually be useful.

This commit is contained in:
Natedog2012 2016-02-27 01:37:35 -08:00
parent 114c6b72bb
commit 2268e6ed34
6 changed files with 12 additions and 9 deletions

View File

@ -975,8 +975,8 @@ namespace RoF
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, emu->drop_id); // Some unique id
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, 0); // Same for all objects in the zone
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, emu->heading);
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, 0); // Normally 0, but seen (float)255.0 as well
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, emu->solidtype); // Unknown
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, 0); // X tilt
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, 0); // Y tilt
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, emu->size != 0 && (float)emu->size < 5000.f ? (float)((float)emu->size / 100.0f) : 1.f ); // This appears to be the size field. Hackish logic because some PEQ DB items were corrupt.
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, emu->y);
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, emu->x);

View File

@ -1046,8 +1046,8 @@ namespace RoF2
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, emu->drop_id); // Some unique id
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, 0); // Same for all objects in the zone
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, emu->heading);
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, 0); // Normally 0, but seen (float)255.0 as well
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, emu->solidtype); // Unknown
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, 0); // X tilt
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, 0); // Y tilt
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, emu->size != 0 && (float)emu->size < 5000.f ? (float)((float)emu->size / 100.0f) : 1.f ); // This appears to be the size field. Hackish logic because some PEQ DB items were corrupt.
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, emu->y);
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, emu->x);

View File

@ -2845,7 +2845,8 @@ struct Object_Struct {
/*00*/ uint32 drop_id; // Unique object id for zone
/*00*/ uint32 unknown024; // 53 9e f9 7e - same for all objects in the zone?
/*00*/ float heading; // heading
/*00*/ float unknown032[2]; // 00 00 00 00 00 00 00 00
/*00*/ float x_tilt; //Tilt entire object on X axis
/*00*/ float y_tilt; //Tilt entire object on Y axis
/*00*/ float size; // Size - default 1
/*00*/ float z; // z coord
/*00*/ float x; // x coord

View File

@ -2873,7 +2873,8 @@ struct Object_Struct {
/*00*/ uint32 drop_id; // Unique object id for zone
/*00*/ uint32 unknown024; // 53 9e f9 7e - same for all objects in the zone?
/*00*/ float heading; // heading
/*00*/ float unknown032[2]; // 00 00 00 00 00 00 00 00
/*00*/ float x_tilt; //Tilt entire object on X axis
/*00*/ float y_tilt; //Tilt entire object on Y axis
/*00*/ float size; // Size - default 1
/*00*/ float z; // z coord
/*00*/ float x; // x coord

View File

@ -857,8 +857,8 @@ namespace UF
// This next field is actually a float. There is a groundspawn in freeportwest (sack of money sitting on some barrels) which requires this
// field to be set to (float)255.0 to appear at all, and also the size field below to be 5, to be the correct size. I think SoD has the same
// issue.
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, 0);
VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, emu->solidtype); // Unknown, observed 0
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, 0); //X tilt
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, 0); //Y tilt
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, emu->size != 0 && (float)emu->size < 5000.f ? (float)((float)emu->size / 100.0f) : 1.f ); // This appears to be the size field. Hackish logic because some PEQ DB items were corrupt.
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, emu->y);
VARSTRUCT_ENCODE_TYPE(float, OutBuffer, emu->x);

View File

@ -2450,7 +2450,8 @@ struct Object_Struct {
/*20*/ uint32 unknown020; // 00 00 00 00
/*24*/ uint32 unknown024; // 53 9e f9 7e - same for all objects in the zone?
/*40*/ float heading; // heading
/*32*/ uint8 unknown032[8]; // 00 00 00 00 00 00 00 00
/*00*/ float x_tilt; //Tilt entire object on X axis
/*00*/ float y_tilt; //Tilt entire object on Y axis
/*28*/ float size; // Size - default 1
/*44*/ float z; // z coord
/*48*/ float x; // x coord