Merge pull request #211 from lioncash/init

CPlayerEnergyDrain: Initialize x10_energyDrainTime on construction
This commit is contained in:
Phillip Stephens 2020-03-12 15:10:28 -07:00 committed by GitHub
commit 8badbd3f35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

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

View File

@ -4,7 +4,7 @@
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); }

View File

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