CSpankWeed: Make use of std::array where applicable

Same behavior, but without array to pointer decay.
This commit is contained in:
Lioncash 2020-04-12 11:21:06 -04:00
parent 23bae06742
commit cb857bd737
1 changed files with 13 additions and 3 deletions

View File

@ -1,5 +1,7 @@
#include "Runtime/MP1/World/CSpankWeed.hpp" #include "Runtime/MP1/World/CSpankWeed.hpp"
#include <array>
#include "Runtime/CStateManager.hpp" #include "Runtime/CStateManager.hpp"
#include "Runtime/Collision/CCollisionActor.hpp" #include "Runtime/Collision/CCollisionActor.hpp"
#include "Runtime/World/CPatternedInfo.hpp" #include "Runtime/World/CPatternedInfo.hpp"
@ -9,6 +11,17 @@
namespace urde::MP1 { namespace urde::MP1 {
logvisor::Module SpankLog("urde::MP1::SpankWeed"); logvisor::Module SpankLog("urde::MP1::SpankWeed");
constexpr std::array<SSphereJointInfo, 7> kArmCollision{{
{"Arm_4", 1.5f},
{"Arm_6", 1.f},
{"Arm_7", 1.f},
{"Arm_8", 1.f},
{"Arm_9", 1.f},
{"Arm_11", 1.f},
{"Swoosh_LCTR", 1.5f},
}};
CSpankWeed::CSpankWeed(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, CSpankWeed::CSpankWeed(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
CModelData&& mData, const CActorParameters& actParms, const CPatternedInfo& pInfo, CModelData&& mData, const CActorParameters& actParms, const CPatternedInfo& pInfo,
float maxDetectionRange, float maxHearingRange, float maxSightRange, float hideTime) float maxDetectionRange, float maxHearingRange, float maxSightRange, float hideTime)
@ -48,9 +61,6 @@ CSpankWeed::CSpankWeed(TUniqueId uid, std::string_view name, const CEntityInfo&
x460_knockBackController.SetAutoResetImpulse(false); x460_knockBackController.SetAutoResetImpulse(false);
} }
static const SSphereJointInfo kArmCollision[] = {{"Arm_4", 1.5f}, {"Arm_6", 1.f}, {"Arm_7", 1.f}, {"Arm_8", 1.f},
{"Arm_9", 1.f}, {"Arm_11", 1.f}, {"Swoosh_LCTR", 1.5f}};
void CSpankWeed::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) { void CSpankWeed::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) {
bool oldActive = GetActive(); bool oldActive = GetActive();
if (msg == EScriptObjectMessage::Activate) { if (msg == EScriptObjectMessage::Activate) {