mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
In 'datacache/mdlcache.cpp' the function 'CMDLCache::FindMDL' attempts to find 'mdl/error.rmdl' and assigns the studiohdr and handle to the members of CMDLFallback. In 'CMDLCache::FindUncachedMDL' we check if a model exists, if a model does not exist, we replace the studiohdr with the one of error.rmdl we stored in the CMDLFallback structure. This does actually work (on the dedicated server it doesn't crash at all!), but on the client it crashes when trying to gather props (right before rendering), setting the ConVar* 'old_gather_props' does interesting things (check IDA around this ConVar*). setting this to 1 causes it to crash in another CMDLCache method when trying to deref something in the global cache pool. This method is easy to rebuild. I will do this soon and attempt to return error.rmdl parts from here as well if results are null (this might actually just work). Leaving 'old_gather_props' to 0 causes it to crash in the middle of the function which is supposed to gather the props the 'new' way. The gather props functions are kind of daunting NOTE: Currently only confirmed to work somewhat properly on the dedicated server for prop_static. prop_dynamic is unconfirmed. And (almost?) works on the client.
71 lines
1.4 KiB
C
71 lines
1.4 KiB
C
#ifndef STUDIO_H
|
|
#define STUDIO_H
|
|
#include "mathlib/vector.h"
|
|
|
|
#pragma pack(push, 1)
|
|
struct studiohdr_t
|
|
{
|
|
int id; // 'IDST'
|
|
int version; // R5 = '6'
|
|
int checksum;
|
|
int tableIndex; // Offset
|
|
|
|
char name[0x40];
|
|
|
|
int length; // size of data
|
|
|
|
Vector3 eyeposition; // ideal eye position
|
|
Vector3 illumposition; // illumination center
|
|
Vector3 hull_min; // ideal movement hull size
|
|
Vector3 hull_max;
|
|
Vector3 view_bbmin; // clipping bounding box
|
|
Vector3 view_bbmax;
|
|
|
|
int flags;
|
|
|
|
int numbones; // bones
|
|
int boneindex;
|
|
|
|
int numbonecontrollers;
|
|
int bonecontrollerindex;
|
|
|
|
int numhitboxsets;
|
|
int hitboxsetindex;
|
|
|
|
int numlocalanim; // animations/poses
|
|
int localanimindex; // animation descriptions
|
|
|
|
int numlocalseq; // sequences
|
|
int localseqindex;
|
|
|
|
int activitylistversion; // initialization flag - have the sequences been indexed ?
|
|
int eventsindexed;
|
|
|
|
int numtextures;
|
|
int textureindex;
|
|
|
|
int numcdtextures;
|
|
int cdtextureindex;
|
|
|
|
int numskinref; // Total number of references (submeshes)
|
|
int numskinfamilies; // Total skins per reference
|
|
int skinindex; // Offset to data
|
|
|
|
int numbodyparts;
|
|
int bodypartindex;
|
|
|
|
int numlocalattachments;
|
|
int localattachmentindex;
|
|
|
|
uint8_t Unknown2[0x14];
|
|
|
|
int submeshLodsIndex;
|
|
|
|
uint8_t Unknown3[0x64];
|
|
int boneRemapInfoIndex;
|
|
int boneRemapCount;
|
|
};
|
|
#pragma pack(pop)
|
|
|
|
#endif // STUDIO_H
|