diff --git a/src/PSOProtocol.hh b/src/PSOProtocol.hh index e2a85f7c..e95670e1 100644 --- a/src/PSOProtocol.hh +++ b/src/PSOProtocol.hh @@ -120,6 +120,12 @@ T& check_size_t(void* data, size_t size) { return check_size_generic(data, size, sizeof(T), sizeof(T)); } +template +T* check_size_vec_t(std::string& data, size_t count) { + size_t expected_size = count * sizeof(T); + return &check_size_generic(data.data(), data.size(), expected_size, expected_size); +} + void check_size_v(size_t size, size_t min_size, size_t max_size = 0); std::string prepend_command_header( diff --git a/src/SaveFileFormats.hh b/src/SaveFileFormats.hh index a45547c5..9713dd62 100644 --- a/src/SaveFileFormats.hh +++ b/src/SaveFileFormats.hh @@ -14,6 +14,7 @@ #include "Episode3/DataIndexes.hh" #include "ItemNameIndex.hh" #include "PSOEncryption.hh" +#include "PSOProtocol.hh" #include "PlayerSubordinates.hh" #include "Text.hh"