Skip to content

Commit 4246116

Browse files
fix(drawable): Prevent crash when copying null tint envelope to rider
1 parent b7cfeaf commit 4246116

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DOverlordTankDraw.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ void W3DOverlordTankDraw::doDrawModule(const Matrix3D* transformMtx)
8686
)
8787
{
8888
Drawable *riderDraw = me->getContain()->friend_getRider()->getDrawable();
89-
riderDraw->setColorTintEnvelope( *getDrawable()->getColorTintEnvelope() );
89+
TintEnvelope *env = getDrawable()->getColorTintEnvelope();
90+
if ( env )
91+
riderDraw->setColorTintEnvelope( *env );
9092

9193
riderDraw->notifyDrawableDependencyCleared();
9294
riderDraw->draw( );// What the hell? This param isn't used for anything

Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DOverlordTruckDraw.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ void W3DOverlordTruckDraw::doDrawModule(const Matrix3D* transformMtx)
8686
)
8787
{
8888
Drawable *riderDraw = me->getContain()->friend_getRider()->getDrawable();
89-
riderDraw->setColorTintEnvelope( *getDrawable()->getColorTintEnvelope() );
89+
TintEnvelope *env = getDrawable()->getColorTintEnvelope();
90+
if ( env )
91+
riderDraw->setColorTintEnvelope( *env );
9092

9193
riderDraw->notifyDrawableDependencyCleared();
9294
riderDraw->draw();

0 commit comments

Comments
 (0)