Fix typo in CPlayerState::ReInitializePowerUp

This commit is contained in:
Henrique Gemignani Passos Lima 2021-03-16 00:43:28 +02:00
parent 268e7d143f
commit bad8b35ae6
4 changed files with 7 additions and 7 deletions

View File

@ -371,7 +371,7 @@ void CPlayerState::AddPowerUp(CPlayerState::EItemType type, u32 capacity) {
} }
} }
void CPlayerState::ReInitalizePowerUp(CPlayerState::EItemType type, u32 capacity) { void CPlayerState::ReInitializePowerUp(CPlayerState::EItemType type, u32 capacity) {
x24_powerups[u32(type)].x4_capacity = 0; x24_powerups[u32(type)].x4_capacity = 0;
AddPowerUp(type, capacity); AddPowerUp(type, capacity);
} }

View File

@ -151,7 +151,7 @@ public:
static float GetEnergyTankCapacity() { return 100.f; } static float GetEnergyTankCapacity() { return 100.f; }
static float GetBaseHealthCapacity() { return 99.f; } static float GetBaseHealthCapacity() { return 99.f; }
float CalculateHealth(); float CalculateHealth();
void ReInitalizePowerUp(EItemType type, u32 capacity); void ReInitializePowerUp(EItemType type, u32 capacity);
void AddPowerUp(EItemType type, u32 capacity); void AddPowerUp(EItemType type, u32 capacity);
u32 GetLogScans() const { return x180_scanCompletionRate.first; } u32 GetLogScans() const { return x180_scanCompletionRate.first; }
u32 GetTotalLogScans() const { return x180_scanCompletionRate.second; } u32 GetTotalLogScans() const { return x180_scanCompletionRate.second; }

View File

@ -460,7 +460,7 @@ void CMain::Give(hecl::Console* console, const std::vector<std::string>& args) {
std::shared_ptr<CPlayerState> pState = g_GameState->GetPlayerState(); std::shared_ptr<CPlayerState> pState = g_GameState->GetPlayerState();
if (type == "all") { if (type == "all") {
for (u32 item = 0; item < u32(CPlayerState::EItemType::Max); ++item) { for (u32 item = 0; item < u32(CPlayerState::EItemType::Max); ++item) {
pState->ReInitalizePowerUp(CPlayerState::EItemType(item), pState->ReInitializePowerUp(CPlayerState::EItemType(item),
CPlayerState::GetPowerUpMaxValue(CPlayerState::EItemType(item))); CPlayerState::GetPowerUpMaxValue(CPlayerState::EItemType(item)));
pState->IncrPickup(CPlayerState::EItemType(item), pState->IncrPickup(CPlayerState::EItemType(item),
CPlayerState::GetPowerUpMaxValue(CPlayerState::EItemType(item))); CPlayerState::GetPowerUpMaxValue(CPlayerState::EItemType(item)));
@ -496,9 +496,9 @@ void CMain::Give(hecl::Console* console, const std::vector<std::string>& args) {
/* Handle special case with Missiles */ /* Handle special case with Missiles */
if (eType == CPlayerState::EItemType::Missiles) { if (eType == CPlayerState::EItemType::Missiles) {
u32 tmp = ((u32(itemAmt) / 5) + (itemAmt % 5)) * 5; u32 tmp = ((u32(itemAmt) / 5) + (itemAmt % 5)) * 5;
pState->ReInitalizePowerUp(eType, tmp); pState->ReInitializePowerUp(eType, tmp);
} else { } else {
pState->ReInitalizePowerUp(eType, itemAmt); pState->ReInitializePowerUp(eType, itemAmt);
} }
} }
@ -530,7 +530,7 @@ void CMain::Remove(hecl::Console*, const std::vector<std::string>& args) {
} else { } else {
CPlayerState::EItemType eType = CPlayerState::ItemNameToType(type); CPlayerState::EItemType eType = CPlayerState::ItemNameToType(type);
if (eType != CPlayerState::EItemType::Invalid) { if (eType != CPlayerState::EItemType::Invalid) {
pState->ReInitalizePowerUp(eType, 0); pState->ReInitializePowerUp(eType, 0);
if (g_StateManager != nullptr) { if (g_StateManager != nullptr) {
g_StateManager->Player()->AsyncLoadSuit(*g_StateManager); g_StateManager->Player()->AsyncLoadSuit(*g_StateManager);
} }

View File

@ -42,7 +42,7 @@ void CScriptSpawnPoint::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objI
using EPlayerItemType = CPlayerState::EItemType; using EPlayerItemType = CPlayerState::EItemType;
const std::shared_ptr<CPlayerState>& plState = stateMgr.GetPlayerState(); const std::shared_ptr<CPlayerState>& plState = stateMgr.GetPlayerState();
for (u32 i = 0; i < u32(EPlayerItemType::Max); ++i) { for (u32 i = 0; i < u32(EPlayerItemType::Max); ++i) {
plState->ReInitalizePowerUp(EPlayerItemType(i), GetPowerup(EPlayerItemType(i))); plState->ReInitializePowerUp(EPlayerItemType(i), GetPowerup(EPlayerItemType(i)));
plState->ResetAndIncrPickUp(EPlayerItemType(i), GetPowerup(EPlayerItemType(i))); plState->ResetAndIncrPickUp(EPlayerItemType(i), GetPowerup(EPlayerItemType(i)));
} }
} }