mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-12-22 20:50:15 +00:00
Changed how the TryParse function works (and also did some general cleanup along the way)
This commit is contained in:
@@ -87,10 +87,8 @@ ItemSet::ItemSet(const uint32_t id, InventoryComponent* inventoryComponent) {
|
||||
m_Items = {};
|
||||
|
||||
while (std::getline(stream, token, ',')) {
|
||||
int32_t value;
|
||||
if (GeneralUtils::TryParse(token, value)) {
|
||||
m_Items.push_back(value);
|
||||
}
|
||||
const auto validToken = GeneralUtils::TryParse<int32_t>(token);
|
||||
if (validToken) m_Items.push_back(validToken.value());
|
||||
}
|
||||
|
||||
m_Equipped = {};
|
||||
|
||||
Reference in New Issue
Block a user