From a38417bf5442953f7fd22acf32ebae37c7645d8f Mon Sep 17 00:00:00 2001 From: Uleat Date: Tue, 31 May 2016 19:12:54 -0400 Subject: [PATCH] More eq_dictionary work - added invtype persistence checks --- common/patches/rof2_limits.cpp | 18 ++++++++++++++++++ common/patches/rof2_limits.h | 2 ++ common/patches/rof_limits.cpp | 18 ++++++++++++++++++ common/patches/rof_limits.h | 2 ++ common/patches/sod_limits.cpp | 17 +++++++++++++++++ common/patches/sod_limits.h | 2 ++ common/patches/sof_limits.cpp | 17 +++++++++++++++++ common/patches/sof_limits.h | 2 ++ common/patches/titanium_limits.cpp | 17 +++++++++++++++++ common/patches/titanium_limits.h | 2 ++ common/patches/uf_limits.cpp | 17 +++++++++++++++++ common/patches/uf_limits.h | 2 ++ 12 files changed, 116 insertions(+) diff --git a/common/patches/rof2_limits.cpp b/common/patches/rof2_limits.cpp index c515e2512..85e15e21d 100644 --- a/common/patches/rof2_limits.cpp +++ b/common/patches/rof2_limits.cpp @@ -140,6 +140,24 @@ const char* RoF2::invtype::GetInvTypeName(int inv_type) } } +bool RoF2::invtype::IsInvTypePersistent(int inv_type) +{ + switch (inv_type) { + case invtype::InvTypePossessions: + case invtype::InvTypeBank: + case invtype::InvTypeSharedBank: + case invtype::InvTypeTrade: + case invtype::InvTypeWorld: + case invtype::InvTypeLimbo: + case invtype::InvTypeTribute: + case invtype::InvTypeTrophyTribute: + case invtype::InvTypeGuildTribute: + return true; + default: + return false; + } +} + const char* RoF2::invslot::GetInvPossessionsSlotName(int inv_slot) { switch (inv_slot) { diff --git a/common/patches/rof2_limits.h b/common/patches/rof2_limits.h index 605073ad7..fb2f997ca 100644 --- a/common/patches/rof2_limits.h +++ b/common/patches/rof2_limits.h @@ -231,6 +231,8 @@ namespace RoF2 extern size_t GetInvTypeSize(int inv_type); extern const char* GetInvTypeName(int inv_type); + extern bool IsInvTypePersistent(int inv_type); + } /*invtype*/ namespace invslot { diff --git a/common/patches/rof_limits.cpp b/common/patches/rof_limits.cpp index 48639d52c..c78ffc59d 100644 --- a/common/patches/rof_limits.cpp +++ b/common/patches/rof_limits.cpp @@ -136,6 +136,24 @@ const char* RoF::invtype::GetInvTypeName(int inv_type) } } +bool RoF::invtype::IsInvTypePersistent(int inv_type) +{ + switch (inv_type) { + case invtype::InvTypePossessions: + case invtype::InvTypeBank: + case invtype::InvTypeSharedBank: + case invtype::InvTypeTrade: + case invtype::InvTypeWorld: + case invtype::InvTypeLimbo: + case invtype::InvTypeTribute: + case invtype::InvTypeTrophyTribute: + case invtype::InvTypeGuildTribute: + return true; + default: + return false; + } +} + const char* RoF::invslot::GetInvPossessionsSlotName(int inv_slot) { switch (inv_slot) { diff --git a/common/patches/rof_limits.h b/common/patches/rof_limits.h index 765d61c00..ed0b9a6d0 100644 --- a/common/patches/rof_limits.h +++ b/common/patches/rof_limits.h @@ -222,6 +222,8 @@ namespace RoF extern size_t GetInvTypeSize(int inv_type); extern const char* GetInvTypeName(int inv_type); + extern bool IsInvTypePersistent(int inv_type); + } /*invtype*/ namespace invslot { diff --git a/common/patches/sod_limits.cpp b/common/patches/sod_limits.cpp index 7991801e3..8ff257665 100644 --- a/common/patches/sod_limits.cpp +++ b/common/patches/sod_limits.cpp @@ -116,6 +116,23 @@ const char* SoD::invtype::GetInvTypeName(int inv_type) } } +bool SoD::invtype::IsInvTypePersistent(int inv_type) +{ + switch (inv_type) { + case invtype::InvTypePossessions: + case invtype::InvTypeBank: + case invtype::InvTypeSharedBank: + case invtype::InvTypeTrade: + case invtype::InvTypeWorld: + case invtype::InvTypeLimbo: + case invtype::InvTypeTribute: + case invtype::InvTypeGuildTribute: + return true; + default: + return false; + } +} + const char* SoD::invslot::GetInvPossessionsSlotName(int inv_slot) { switch (inv_slot) { diff --git a/common/patches/sod_limits.h b/common/patches/sod_limits.h index 430ae5b21..fa2c29317 100644 --- a/common/patches/sod_limits.h +++ b/common/patches/sod_limits.h @@ -206,6 +206,8 @@ namespace SoD extern size_t GetInvTypeSize(int inv_type); extern const char* GetInvTypeName(int inv_type); + extern bool IsInvTypePersistent(int inv_type); + } /*invtype*/ namespace invslot { diff --git a/common/patches/sof_limits.cpp b/common/patches/sof_limits.cpp index 7b7cc408b..b33943905 100644 --- a/common/patches/sof_limits.cpp +++ b/common/patches/sof_limits.cpp @@ -116,6 +116,23 @@ const char* SoF::invtype::GetInvTypeName(int inv_type) } } +bool SoF::invtype::IsInvTypePersistent(int inv_type) +{ + switch (inv_type) { + case invtype::InvTypePossessions: + case invtype::InvTypeBank: + case invtype::InvTypeSharedBank: + case invtype::InvTypeTrade: + case invtype::InvTypeWorld: + case invtype::InvTypeLimbo: + case invtype::InvTypeTribute: + case invtype::InvTypeGuildTribute: + return true; + default: + return false; + } +} + const char* SoF::invslot::GetInvPossessionsSlotName(int inv_slot) { switch (inv_slot) { diff --git a/common/patches/sof_limits.h b/common/patches/sof_limits.h index 0317fd72a..575df39ba 100644 --- a/common/patches/sof_limits.h +++ b/common/patches/sof_limits.h @@ -206,6 +206,8 @@ namespace SoF extern size_t GetInvTypeSize(int inv_type); extern const char* GetInvTypeName(int inv_type); + extern bool IsInvTypePersistent(int inv_type); + } /*invtype*/ namespace invslot { diff --git a/common/patches/titanium_limits.cpp b/common/patches/titanium_limits.cpp index fba7db270..3976e8217 100644 --- a/common/patches/titanium_limits.cpp +++ b/common/patches/titanium_limits.cpp @@ -116,6 +116,23 @@ const char* Titanium::invtype::GetInvTypeName(int inv_type) } } +bool Titanium::invtype::IsInvTypePersistent(int inv_type) +{ + switch (inv_type) { + case invtype::InvTypePossessions: + case invtype::InvTypeBank: + case invtype::InvTypeSharedBank: + case invtype::InvTypeTrade: + case invtype::InvTypeWorld: + case invtype::InvTypeLimbo: + case invtype::InvTypeTribute: + case invtype::InvTypeGuildTribute: + return true; + default: + return false; + } +} + const char* Titanium::invslot::GetInvPossessionsSlotName(int inv_slot) { switch (inv_slot) { diff --git a/common/patches/titanium_limits.h b/common/patches/titanium_limits.h index 643b75be7..e631f8492 100644 --- a/common/patches/titanium_limits.h +++ b/common/patches/titanium_limits.h @@ -205,6 +205,8 @@ namespace Titanium extern size_t GetInvTypeSize(int inv_type); extern const char* GetInvTypeName(int inv_type); + extern bool IsInvTypePersistent(int inv_type); + } /*invtype*/ namespace invslot { diff --git a/common/patches/uf_limits.cpp b/common/patches/uf_limits.cpp index 28a1d7c3f..ae415ddd8 100644 --- a/common/patches/uf_limits.cpp +++ b/common/patches/uf_limits.cpp @@ -116,6 +116,23 @@ const char* UF::invtype::GetInvTypeName(int inv_type) } } +bool UF::invtype::IsInvTypePersistent(int inv_type) +{ + switch (inv_type) { + case invtype::InvTypePossessions: + case invtype::InvTypeBank: + case invtype::InvTypeSharedBank: + case invtype::InvTypeTrade: + case invtype::InvTypeWorld: + case invtype::InvTypeLimbo: + case invtype::InvTypeTribute: + case invtype::InvTypeGuildTribute: + return true; + default: + return false; + } +} + const char* UF::invslot::GetInvPossessionsSlotName(int inv_slot) { switch (inv_slot) { diff --git a/common/patches/uf_limits.h b/common/patches/uf_limits.h index e199899dd..2e799ac0c 100644 --- a/common/patches/uf_limits.h +++ b/common/patches/uf_limits.h @@ -206,6 +206,8 @@ namespace UF extern size_t GetInvTypeSize(int inv_type); extern const char* GetInvTypeName(int inv_type); + + extern bool IsInvTypePersistent(int inv_type); } /*invtype*/