mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
fixed camera code not checking for invalid/missing datablock: crashed before
This commit is contained in:
parent
95ef5ec226
commit
c6462a25b4
1 changed files with 3 additions and 3 deletions
|
|
@ -903,7 +903,7 @@ void Camera::_setPosition(const Point3F& pos, const Point3F& rot)
|
||||||
|
|
||||||
MatrixF temp;
|
MatrixF temp;
|
||||||
|
|
||||||
if(mDataBlock->cameraCanBank)
|
if(mDataBlock && mDataBlock->cameraCanBank)
|
||||||
{
|
{
|
||||||
// Take rot.y into account to bank the camera
|
// Take rot.y into account to bank the camera
|
||||||
MatrixF imat;
|
MatrixF imat;
|
||||||
|
|
@ -932,7 +932,7 @@ void Camera::setRotation(const Point3F& rot)
|
||||||
|
|
||||||
MatrixF temp;
|
MatrixF temp;
|
||||||
|
|
||||||
if(mDataBlock->cameraCanBank)
|
if(mDataBlock && mDataBlock->cameraCanBank)
|
||||||
{
|
{
|
||||||
// Take rot.y into account to bank the camera
|
// Take rot.y into account to bank the camera
|
||||||
MatrixF imat;
|
MatrixF imat;
|
||||||
|
|
@ -993,7 +993,7 @@ void Camera::writePacketData(GameConnection *connection, BitStream *bstream)
|
||||||
bstream->setCompressionPoint(pos);
|
bstream->setCompressionPoint(pos);
|
||||||
mathWrite(*bstream, pos);
|
mathWrite(*bstream, pos);
|
||||||
bstream->write(mRot.x);
|
bstream->write(mRot.x);
|
||||||
if(bstream->writeFlag(mDataBlock->cameraCanBank))
|
if(mDataBlock && bstream->writeFlag(mDataBlock->cameraCanBank))
|
||||||
{
|
{
|
||||||
// Include mRot.y to allow for camera banking
|
// Include mRot.y to allow for camera banking
|
||||||
bstream->write(mRot.y);
|
bstream->write(mRot.y);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue