Skip to content

Commit 926616a

Browse files
committed
fix crash with missing matfx matrices; stop wood from spray blood drops
1 parent 988fc5f commit 926616a

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/buildingPipe.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@ CCustomBuildingDNPipeline__CustomPipeRenderCB_PS2(RwResEntry *repEntry, void *ob
203203
int effect = RpMatFXMaterialGetEffects(material);
204204
if(effect == rpMATFXEFFECTUVTRANSFORM){
205205
RpMatFXMaterialGetUVTransformMatrices(material, &m1, &m2);
206-
RwD3D9SetVertexShaderConstant(REG_texmat, m1, 4);
206+
if(m1)
207+
RwD3D9SetVertexShaderConstant(REG_texmat, m1, 4);
208+
else
209+
RwD3D9SetVertexShaderConstant(REG_texmat, &ident, 4);
207210
}else
208211
RwD3D9SetVertexShaderConstant(REG_texmat, &ident, 4);
209212

@@ -327,7 +330,10 @@ CCustomBuildingDNPipeline__CustomPipeRenderCB_Xbox(RwResEntry *repEntry, void *o
327330
int effect = RpMatFXMaterialGetEffects(material);
328331
if(effect == rpMATFXEFFECTUVTRANSFORM){
329332
RpMatFXMaterialGetUVTransformMatrices(material, &m1, &m2);
330-
RwD3D9SetVertexShaderConstant(REG_texmat, m1, 4);
333+
if(m1)
334+
RwD3D9SetVertexShaderConstant(REG_texmat, m1, 4);
335+
else
336+
RwD3D9SetVertexShaderConstant(REG_texmat, &ident, 4);
331337
}else
332338
RwD3D9SetVertexShaderConstant(REG_texmat, &ident, 4);
333339

@@ -439,7 +445,10 @@ CCustomBuildingDNPipeline__CustomPipeRenderCB_Sphere(RwResEntry *repEntry, void
439445
int effect = RpMatFXMaterialGetEffects(material);
440446
if(effect == rpMATFXEFFECTUVTRANSFORM){
441447
RpMatFXMaterialGetUVTransformMatrices(material, &m1, &m2);
442-
RwD3D9SetVertexShaderConstant(REG_texmat, m1, 4);
448+
if(m1)
449+
RwD3D9SetVertexShaderConstant(REG_texmat, m1, 4);
450+
else
451+
RwD3D9SetVertexShaderConstant(REG_texmat, &ident, 4);
443452
}else
444453
RwD3D9SetVertexShaderConstant(REG_texmat, &ident, 4);
445454

src/neoWaterdrops.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ hookWaterDrops()
285285
//injector::MakeCALL(0x5E37AF, f2, true); // "prt_splash"
286286
//injector::MakeCALL(0x5E3782, f2, true); // "prt_splash"
287287
injector::MakeCALL(0x49FEEE, f2, true); // "prt_boatsplash"
288-
injector::MakeCALL(0x49F01F, f2, true); // "prt_blood"
288+
//injector::MakeCALL(0x49F01F, f2, true); // "prt_blood"
289289
injector::MakeCALL(0x49EC92, f2, true); // "prt_blood"
290290

291291
//chainsaw

0 commit comments

Comments
 (0)