diff --git a/Source/Engine/Core/Collections/Array.h b/Source/Engine/Core/Collections/Array.h index 3819323a9..9b8c41245 100644 --- a/Source/Engine/Core/Collections/Array.h +++ b/Source/Engine/Core/Collections/Array.h @@ -758,7 +758,6 @@ public: /// /// Performs pop from stack operation (stack grows at the end of the collection). /// - /// The item. T Pop() { T item(Last()); @@ -769,19 +768,19 @@ public: /// /// Peeks items which is at the top of the stack (stack grows at the end of the collection). /// - /// The item. FORCE_INLINE T& Peek() { - return Last(); + ASSERT(_count > 0); + return Get()[_count - 1]; } /// /// Peeks items which is at the top of the stack (stack grows at the end of the collection). /// - /// The item. FORCE_INLINE const T& Peek() const { - return Last(); + ASSERT(_count > 0); + return Get()[_count - 1]; } public: diff --git a/Source/Engine/Physics/Physics.cpp b/Source/Engine/Physics/Physics.cpp index 333b21e99..bdee2fdc2 100644 --- a/Source/Engine/Physics/Physics.cpp +++ b/Source/Engine/Physics/Physics.cpp @@ -638,9 +638,9 @@ void Physics::Simulate(float dt) void Physics::CollectResults() { - ASSERT(IsInMainThread()); if (!_isDuringSimulation) return; + ASSERT(IsInMainThread()); ASSERT(CPhysX && Stepper); {