mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-25 15:07:28 +00:00
Merge pull request #505 from EmosewaMC/Vault-fixes
Addressed vault size issues
This commit is contained in:
commit
a3e2aa2a97
@ -2173,3 +2173,15 @@ void Entity::AddToGroup(const std::string& group) {
|
||||
m_Groups.push_back(group);
|
||||
}
|
||||
}
|
||||
|
||||
void Entity::RetroactiveVaultSize() {
|
||||
auto inventoryComponent = GetComponent<InventoryComponent>();
|
||||
if (!inventoryComponent) return;
|
||||
|
||||
auto itemsVault = inventoryComponent->GetInventory(eInventoryType::VAULT_ITEMS);
|
||||
auto modelVault = inventoryComponent->GetInventory(eInventoryType::VAULT_MODELS);
|
||||
|
||||
if (itemsVault->GetSize() == modelVault->GetSize()) return;
|
||||
|
||||
modelVault->SetSize(itemsVault->GetSize());
|
||||
}
|
||||
|
@ -220,7 +220,11 @@ public:
|
||||
/*
|
||||
* Utility
|
||||
*/
|
||||
|
||||
/**
|
||||
* Retroactively corrects the model vault size due to incorrect initialization in a previous patch.
|
||||
*
|
||||
*/
|
||||
void RetroactiveVaultSize();
|
||||
bool GetBoolean(const std::u16string& name) const;
|
||||
int32_t GetI32(const std::u16string& name) const;
|
||||
int64_t GetI64(const std::u16string& name) const;
|
||||
|
@ -291,7 +291,7 @@ void UserManager::CreateCharacter(const SystemAddress& sysAddr, Packet* packet)
|
||||
xml << "ls=\"0\" lzx=\"-626.5847\" lzy=\"613.3515\" lzz=\"-28.6374\" lzrx=\"0.0\" lzry=\"0.7015\" lzrz=\"0.0\" lzrw=\"0.7126\" ";
|
||||
xml << "stt=\"0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;\"></char>";
|
||||
xml << "<dest hm=\"4\" hc=\"4\" im=\"0\" ic=\"0\" am=\"0\" ac=\"0\" d=\"0\"/>";
|
||||
xml << "<inv><bag><b t=\"0\" m=\"20\"/><b t=\"1\" m=\"240\"/><b t=\"2\" m=\"240\"/><b t=\"3\" m=\"240\"/></bag><items><in t=\"0\">";
|
||||
xml << "<inv><bag><b t=\"0\" m=\"20\"/><b t=\"1\" m=\"40\"/><b t=\"2\" m=\"240\"/><b t=\"3\" m=\"240\"/><b t=\"14\" m=\"40\"/></bag><items><in t=\"0\">";
|
||||
std::string xmlSave1 = xml.str();
|
||||
|
||||
ObjectIDManager::Instance()->RequestPersistentID([=](uint32_t idforshirt) {
|
||||
|
@ -84,6 +84,7 @@ Inventory* InventoryComponent::GetInventory(const eInventoryType type)
|
||||
case eInventoryType::ITEMS:
|
||||
size = 20u;
|
||||
break;
|
||||
case eInventoryType::VAULT_MODELS:
|
||||
case eInventoryType::VAULT_ITEMS:
|
||||
size = 40u;
|
||||
break;
|
||||
|
@ -511,9 +511,11 @@ void Mission::YieldRewards() {
|
||||
}
|
||||
|
||||
if (info->reward_bankinventory > 0) {
|
||||
auto* inventory = inventoryComponent->GetInventory(VAULT_ITEMS);
|
||||
auto* inventory = inventoryComponent->GetInventory(eInventoryType::VAULT_ITEMS);
|
||||
auto modelInventory = inventoryComponent->GetInventory(eInventoryType::VAULT_MODELS);
|
||||
|
||||
inventory->SetSize(inventory->GetSize() + info->reward_bankinventory);
|
||||
modelInventory->SetSize(modelInventory->GetSize() + info->reward_bankinventory);
|
||||
}
|
||||
|
||||
if (info->reward_reputation > 0) {
|
||||
|
@ -975,6 +975,8 @@ void HandlePacket(Packet* packet) {
|
||||
player->GetComponent<CharacterComponent>()->SetLastRocketConfig(u"");
|
||||
|
||||
c->SetRetroactiveFlags();
|
||||
|
||||
player->RetroactiveVaultSize();
|
||||
|
||||
player->GetCharacter()->SetTargetScene("");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user