Skip to content

Commit bf51098

Browse files
Synchronize changes from 1.6 master branch [ci skip]
6a17b64 Fix for missing vehicle paintjobs after model replacement (#4402) f270152 Update crowdin-translators.json
2 parents eaa3805 + 6a17b64 commit bf51098

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

Client/game_sa/CRenderWareSA.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ RpClump* CRenderWareSA::ReadDFF(const SString& strFilename, const SString& buffe
283283
return NULL;
284284
}
285285

286-
// rockstar's collision hack: set the global particle emitter to the modelinfo pointer of this model
287286
if (bLoadEmbeddedCollisions)
288287
{
289288
// Vehicles have their collision loaded through the CollisionModel plugin, so we need to remove the current collision to prevent a memory leak.
@@ -295,15 +294,26 @@ RpClump* CRenderWareSA::ReadDFF(const SString& strFilename, const SString& buffe
295294
((void(__thiscall*)(CBaseModelInfoSAInterface*))0x4C4C40)(modelInfoInterface); // CBaseModelInfo::DeleteCollisionModel
296295
}
297296

297+
// rockstar's collision hack
298+
// It sets the pointer CCollisionPlugin::ms_currentModel to the model info of the given vehicle in order to correctly set up the vehicle’s
299+
// collision during collision plugin reading (0x41B2BD).
298300
RpPrtStdGlobalDataSetStreamEmbedded((void*)pPool[usModelID]);
301+
302+
// Call CVehicleModelInfo::UseCommonVehicleTexDicationary
303+
((void(__cdecl*)())0x4C75A0)();
299304
}
300305

301306
// read the clump with all its extensions
302307
RpClump* pClump = RpClumpStreamRead(streamModel);
303308

304-
// reset collision hack
305309
if (bLoadEmbeddedCollisions)
306-
RpPrtStdGlobalDataSetStreamEmbedded(NULL);
310+
{
311+
// reset collision hack
312+
RpPrtStdGlobalDataSetStreamEmbedded(nullptr);
313+
314+
// Call CVehicleModelInfo::StopUsingCommonVehicleTexDicationary
315+
((void(__cdecl*)())0x4C75C0)();
316+
}
307317

308318
// close the stream
309319
RwStreamClose(streamModel, NULL);

utils/localization/generate-translators/crowdin-translators.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
"Avenger",
1313
"Bydlo",
1414
"ccw",
15+
"chbaya7 chbaya7 (chbaya701)",
1516
"Conolel",
17+
"Crown (x-Crown)",
1618
"DABL",
1719
"devmedoo",
1820
"Elizeu Monteiro (elizeuszernek)",

0 commit comments

Comments
 (0)