Quellcode durchsuchen

[cpp] Fix null dereference in PhysicsConstraintResetTimeline. Closes #2694

Mario Zechner vor 7 Monaten
Ursprung
Commit
43b9f6cab3
1 geänderte Dateien mit 1 neuen und 0 gelöschten Zeilen
  1. 1 0
      spine-cpp/spine-cpp/src/spine/PhysicsConstraintTimeline.cpp

+ 1 - 0
spine-cpp/spine-cpp/src/spine/PhysicsConstraintTimeline.cpp

@@ -95,6 +95,7 @@ void PhysicsConstraintResetTimeline::apply(Skeleton &skeleton, float lastTime, f
 		else {
 			Vector<PhysicsConstraint *> &physicsConstraints = skeleton.getPhysicsConstraints();
 			for (size_t i = 0; i < physicsConstraints.size(); i++) {
+				constraint = physicsConstraints[i];
 				if (constraint->_active) constraint->reset();
 			}
 		}