@@ -20,6 +20,8 @@ void DirLoaderOpenFileHook(DirLoader *thisDirLoader)
2020}
2121*/
2222
23+ static char headPath [512 ] = "char/main/head/male/head_custom.milo" ;
24+
2325void LoadObj (Object * object , BinStream * stream )
2426{
2527 char newPath [512 ] = {0 };
@@ -91,4 +93,57 @@ void VertexReadHook(BinStream *thisBinStream, Vector3 *vec3)
9193
9294 return ;
9395#endif
96+ }
97+
98+
99+ // the third arg is not really a String but a FilePath but shhh i wont tell if you dont
100+ void MakeOutfitPathHook (void * thisBandCharDesc , Symbol part , String * filePath )
101+ {
102+ const char * path ;
103+ char * copy ;
104+ size_t len ;
105+
106+ // check if the head is hidden on the prefab and we are trying to load the head part
107+ if (* (char * )((char * )thisBandCharDesc + 0x20 ) == 1 && strcmp (part .sym , "head" ) == 0 )
108+ {
109+ // determine gender, gender is a Symbol at 0x10
110+ Symbol * genderSym = (Symbol * )((char * )thisBandCharDesc + 0x10 );
111+ if (strcmp (genderSym -> sym , "female" ) == 0 )
112+ {
113+ path = "char/main/head/female/head_custom.milo" ;
114+ len = strlen (path );
115+
116+ RB3E_DEBUG ("Head is hidden on female prefab, using custom head milo" , 0 );
117+
118+ copy = (char * )malloc (len + 1 );
119+ if (copy != NULL )
120+ {
121+ strcpy (copy , path );
122+ filePath -> buf = copy ;
123+ filePath -> length = (int )len ;
124+ }
125+ return ;
126+ }
127+ else if (strcmp (genderSym -> sym , "male" ) == 0 )
128+ {
129+ path = "char/main/head/male/head_custom.milo" ;
130+ len = strlen (path );
131+
132+ RB3E_DEBUG ("Head is hidden on male prefab, using custom head milo" , 0 );
133+
134+ copy = (char * )malloc (len + 1 );
135+ if (copy != NULL )
136+ {
137+ strcpy (copy , path );
138+ filePath -> buf = copy ;
139+ filePath -> length = (int )len ;
140+ }
141+ return ;
142+ } else {
143+ RB3E_DEBUG ("Unknown gender, cannot load custom head milo" , 0 );
144+ return ;
145+ }
146+ }
147+
148+ MakeOutfitPath (thisBandCharDesc , part , filePath );
94149}
0 commit comments