This commit is contained in:
Aaron Kimbre 2023-11-13 22:39:19 -06:00
parent 68e5737b74
commit dbc02b12b1
4 changed files with 21 additions and 3 deletions

View File

@ -15,7 +15,9 @@ enum class eCharacterVersion : uint32_t {
// Fixes vault size value
VAULT_SIZE,
// Fixes speed base value in level component
UP_TO_DATE, // will become SPEED_BASE
SPEED_BASE,
// Fixes explore missions that were corruped
UP_TO_DATE // Will become EXPLORE
};
#endif //!__ECHARACTERVERSION__H__

View File

@ -620,3 +620,7 @@ bool MissionComponent::HasCollectible(int32_t collectibleID) {
bool MissionComponent::HasMission(uint32_t missionId) {
return GetMission(missionId) != nullptr;
}
void FixExplorerMissions() {
}

View File

@ -170,6 +170,9 @@ public:
*/
bool HasMission(uint32_t missionId);
void FixExplorerMissions();
private:
/**
* All the missions owned by this entity, mapped by mission ID

View File

@ -74,6 +74,7 @@
#include "ZCompression.h"
#include "EntityManager.h"
#include "CheatDetection.h"
#include "MissionComponent.h"
namespace Game {
Logger* logger = nullptr;
@ -1057,6 +1058,9 @@ void HandlePacket(Packet* packet) {
auto* levelComponent = player->GetComponent<LevelProgressionComponent>();
if (!levelComponent) return;
auto* missionComponent = player->GetComponent<MissionComponent>();
if (!missionComponent) return;
auto version = levelComponent->GetCharacterVersion();
switch(version) {
case eCharacterVersion::RELEASE:
@ -1070,9 +1074,14 @@ void HandlePacket(Packet* packet) {
player->RetroactiveVaultSize();
levelComponent->SetCharacterVersion(eCharacterVersion::VAULT_SIZE);
case eCharacterVersion::VAULT_SIZE:
LOG("Updaing Speedbase");
LOG("Updating Speedbase");
levelComponent->SetRetroactiveBaseSpeed();
levelComponent->SetCharacterVersion(eCharacterVersion::UP_TO_DATE);
levelComponent->SetCharacterVersion(eCharacterVersion::SPEED_BASE);
case eCharacterVersion::SPEED_BASE:
LOG("Fixing Explorer missions");
missionComponent->FixExplorerMissions();
// Commented out so it runs every time for testing
// levelComponent->SetCharacterVersion(eCharacterVersion::UP_TO_DATE);
case eCharacterVersion::UP_TO_DATE:
break;
}