CPlayerEnergyDrain: Make constructor explicit

Prevents error-prone implicit constructions from occurring.
This commit is contained in:
Lioncash 2020-03-12 10:01:28 -04:00
parent e628cbf1be
commit d51518dc57
3 changed files with 3 additions and 3 deletions

View File

@ -138,7 +138,7 @@ private:
std::vector<CToken> x25c_ballTransitionsRes; std::vector<CToken> x25c_ballTransitionsRes;
TUniqueId x26c_attachedActor = kInvalidUniqueId; TUniqueId x26c_attachedActor = kInvalidUniqueId;
float x270_attachedActorTime = 0.f; float x270_attachedActorTime = 0.f;
CPlayerEnergyDrain x274_energyDrain = CPlayerEnergyDrain(4); CPlayerEnergyDrain x274_energyDrain{4};
float x288_startingJumpTimeout = 0.f; float x288_startingJumpTimeout = 0.f;
float x28c_sjTimer = 0.f; float x28c_sjTimer = 0.f;
float x290_minJumpTimeout = 0.f; float x290_minJumpTimeout = 0.f;

View File

@ -4,7 +4,7 @@
namespace urde { namespace urde {
CPlayerEnergyDrain::CPlayerEnergyDrain(u32 capacity) { x0_sources.reserve(capacity); } CPlayerEnergyDrain::CPlayerEnergyDrain(u32 numSources) { x0_sources.reserve(numSources); }
void CPlayerEnergyDrain::AddEnergyDrainSource(TUniqueId id, float intensity) { x0_sources.emplace_back(id, intensity); } void CPlayerEnergyDrain::AddEnergyDrainSource(TUniqueId id, float intensity) { x0_sources.emplace_back(id, intensity); }

View File

@ -12,7 +12,7 @@ class CPlayerEnergyDrain {
float x10_energyDrainTime = 0.0f; float x10_energyDrainTime = 0.0f;
public: public:
CPlayerEnergyDrain(u32); explicit CPlayerEnergyDrain(u32 numSources);
const std::vector<CEnergyDrainSource>& GetEnergyDrainSources() const { return x0_sources; } const std::vector<CEnergyDrainSource>& GetEnergyDrainSources() const { return x0_sources; }
void AddEnergyDrainSource(TUniqueId, float); void AddEnergyDrainSource(TUniqueId, float);
void RemoveEnergyDrainSource(TUniqueId id); void RemoveEnergyDrainSource(TUniqueId id);