From 5491f3ff236bc4bdb36fd06749c5c39f9d55b838 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 17 Apr 2020 13:17:01 -0400 Subject: [PATCH] CKnockBackController: Simplify initialization of x24_ in constructor Same behavior, less code. --- Runtime/World/CKnockBackController.cpp | 5 +---- Runtime/World/CKnockBackController.hpp | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Runtime/World/CKnockBackController.cpp b/Runtime/World/CKnockBackController.cpp index 18cbc80e9..2ffa1ebc8 100644 --- a/Runtime/World/CKnockBackController.cpp +++ b/Runtime/World/CKnockBackController.cpp @@ -372,10 +372,7 @@ CKnockBackController::CKnockBackController(EKnockBackVariant variant) , x82_24_(true) , x82_25_inDeferredKnockBack(false) , x82_26_locomotionDuringElectrocution(false) { - for (int i = 0; i < 5; ++i) { - x24_.push_back(std::make_pair(0.f, FLT_MAX)); - x80_availableStates.set(i); - } + x24_.resize(x24_.capacity(), std::make_pair(0.0f, FLT_MAX)); } void CKnockBackController::ApplyImpulse(float dt, CPatterned& parent) { diff --git a/Runtime/World/CKnockBackController.hpp b/Runtime/World/CKnockBackController.hpp index d8bfd46b8..ec3b831e3 100644 --- a/Runtime/World/CKnockBackController.hpp +++ b/Runtime/World/CKnockBackController.hpp @@ -85,7 +85,7 @@ private: u32 x70_ = 0; u32 x74_ = 0; pas::ESeverity x7c_severity = pas::ESeverity::One; - std::bitset<5> x80_availableStates; + std::bitset<5> x80_availableStates{0b11111}; bool x81_24_autoResetImpulse : 1; // t bool x81_25_enableFreeze : 1; // t bool x81_26_enableShock : 1;