Open Rampastring opened 2 years ago
The logic layer printing code only checks for specific RTTI types and lacks an else
case for everything else.
From Red Alert 1 source code, in function Print_CRCs
in QUEUE.CPP
:
if (objp->What_Am_I() == RTTI_AIRCRAFT)
fprintf(fp,"Aircraft (Type:%d) ",
(AircraftType)(*((AircraftClass *)objp)));
else if (objp->What_Am_I() == RTTI_ANIM)
fprintf(fp,"Anim (Type:%d) ",
(AnimType)(*((AnimClass *)objp)));
else if (objp->What_Am_I() == RTTI_BUILDING)
fprintf(fp,"Building (Type:%d) ",
(StructType)(*((BuildingClass *)objp)));
else if (objp->What_Am_I() == RTTI_BULLET)
fprintf(fp,"Bullet (Type:%d) ",
(BulletType)(*((BulletClass *)objp)));
else if (objp->What_Am_I() == RTTI_INFANTRY)
fprintf(fp,"Infantry (Type:%d) ",
(InfantryType)(*((InfantryClass *)objp)));
else if (objp->What_Am_I() == RTTI_OVERLAY)
fprintf(fp,"Overlay (Type:%d) ",
(OverlayType)(*((OverlayClass *)objp)));
else if (objp->What_Am_I() == RTTI_SMUDGE)
fprintf(fp,"Smudge (Type:%d) ",
(SmudgeType)(*((SmudgeClass *)objp)));
else if (objp->What_Am_I() == RTTI_TEMPLATE)
fprintf(fp,"Template (Type:%d) ",
(TemplateType)(*((TemplateClass *)objp)));
else if (objp->What_Am_I() == RTTI_TERRAIN)
fprintf(fp,"Terrain (Type:%d) ",
(TerrainType)(*((TerrainClass *)objp)));
else if (objp->What_Am_I() == RTTI_UNIT)
fprintf(fp,"Unit (Type:%d) ",
(UnitType)(*((UnitClass *)objp)));
Adding an else case like this
else
fprintf(fp, "RTTI:%d ", objp->What_Am_I());
would give us at least the RTTI value of that object.
In TS we could add this in a patch at 0x005B6B35
, which contains the else if (objp->What_Am_I() == RTTI_UNIT)
check.
First Check
Description
Looking at sync logs, the game writes the types of most objects into the log, like this:
However, the game doesn't do this for all objects.
It would be good to know more about these objects for debugging sync issues.
Required Code (optional)
No response
Steps To Reproduce
-
Expected Behaviour
The game should write out the type of the object.
Actual Behaviour
The game doesn't write out the type of the object.
Additional Context
No response