From a702cb9d3fb1dd453d4bbf94ffb92b3586f1fe82 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Tue, 2 Mar 2021 23:53:19 -0500 Subject: [PATCH 1/2] Fix cov-1451232. --- .../FeatureLib/pfConditional/plObjectInBoxConditionalObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/FeatureLib/pfConditional/plObjectInBoxConditionalObject.cpp b/Sources/Plasma/FeatureLib/pfConditional/plObjectInBoxConditionalObject.cpp index 411ad357f9..14f1271ace 100644 --- a/Sources/Plasma/FeatureLib/pfConditional/plObjectInBoxConditionalObject.cpp +++ b/Sources/Plasma/FeatureLib/pfConditional/plObjectInBoxConditionalObject.cpp @@ -254,7 +254,7 @@ bool plVolumeSensorConditionalObject::MsgReceive(plMessage* msg) if (fHittee && fType == kTypeExit) { const plSceneObject* hitteeSO = plSceneObject::ConvertNoRef(fHittee->ObjectIsLoaded()); if (hitteeSO && hitteeSO->IsLocallyOwned() == plSynchedObject::kYes) { - fLogicMod->GetNotify()->AddCollisionEvent(false, pActivateMsg->fHitterObj, pActivateMsg->fHiteeObj, false); + fLogicMod->GetNotify()->AddCollisionEvent(false, page->fPlayer, fHittee, false); if (Satisfied()) fLogicMod->Trigger(false); } From ff344fcd70b26b70398a94c2f7be1343dcd405b4 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Wed, 3 Mar 2021 00:35:47 -0500 Subject: [PATCH 2/2] Fix cov-1451228. Yay [[nodiscard]] --- Sources/Plasma/CoreLib/hsMatrix44.h | 9 +++++++-- Sources/Plasma/FeatureLib/pfPython/cyPhysics.cpp | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Sources/Plasma/CoreLib/hsMatrix44.h b/Sources/Plasma/CoreLib/hsMatrix44.h index c6a650e2dc..05266207ce 100644 --- a/Sources/Plasma/CoreLib/hsMatrix44.h +++ b/Sources/Plasma/CoreLib/hsMatrix44.h @@ -74,6 +74,7 @@ struct hsMatrix44 { void DecompRigid(hsScalarTriple &translate, hsQuat &rotate) const; + [[nodiscard]] static const hsMatrix44& IdentityMatrix(); // worldToCameras and cameraToWorlds are arrays of 6 matrices. Returned are LEFT,RIGHT,FRONT,BACK,TOP,BOTTOM. @@ -118,6 +119,7 @@ struct hsMatrix44 { hsVector3* GetTranslate(hsVector3 *pt) const; hsPoint3* GetTranslate(hsPoint3 *pt) const { return (hsPoint3*)GetTranslate((hsVector3*)pt); } + [[nodiscard]] const hsPoint3 GetTranslate() const { return hsPoint3(fMap[0][3], fMap[1][3], fMap[2][3]); } void GetAxis(hsVector3* view, hsVector3 *up, hsVector3* right); void GetAxisFromCamera(hsVector3* view, hsVector3 *up, hsVector3* right); @@ -135,12 +137,15 @@ struct hsMatrix44 { void MakeZRotation(float radians); + [[nodiscard]] hsPoint3 operator*(const hsPoint3& p) const; + [[nodiscard]] hsVector3 operator*(const hsVector3& p) const; + [[nodiscard]] hsMatrix44 operator *(const hsMatrix44& other) const { return mat_mult.call(*this, other); } - + hsPoint3* MapPoints(long count, hsPoint3 points[]) const; - + bool IsIdentity(); void NotIdentity() { fFlags &= ~kIsIdent; } diff --git a/Sources/Plasma/FeatureLib/pfPython/cyPhysics.cpp b/Sources/Plasma/FeatureLib/pfPython/cyPhysics.cpp index 6cc3555d42..2cf7fdfbd2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyPhysics.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyPhysics.cpp @@ -195,7 +195,6 @@ void cyPhysics::Warp(pyPoint3& pos) // create message PyObject* matObj = pyMatrix44::New(); pyMatrix44* mat = pyMatrix44::ConvertFrom(matObj); - mat->fMatrix.IdentityMatrix(); mat->fMatrix.SetTranslate(&pos.fPoint); WarpMat(*mat); Py_DECREF(matObj);