mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-12-05 07:38:25 +00:00
Changed how the TryParse function works (and also did some general cleanup along the way)
This commit is contained in:
@@ -29,13 +29,15 @@ RenderComponent::RenderComponent(Entity* parent, int32_t componentId): Component
|
||||
auto* animationsTable = CDClientManager::Instance().GetTable<CDAnimationsTable>();
|
||||
auto groupIdsSplit = GeneralUtils::SplitString(animationGroupIDs, ',');
|
||||
for (auto& groupId : groupIdsSplit) {
|
||||
int32_t groupIdInt;
|
||||
if (!GeneralUtils::TryParse(groupId, groupIdInt)) {
|
||||
const auto groupIdInt = GeneralUtils::TryParse<int32_t>(groupId);
|
||||
|
||||
if (!groupIdInt) {
|
||||
LOG("bad animation group Id %s", groupId.c_str());
|
||||
continue;
|
||||
}
|
||||
m_animationGroupIds.push_back(groupIdInt);
|
||||
animationsTable->CacheAnimationGroup(groupIdInt);
|
||||
|
||||
m_animationGroupIds.push_back(groupIdInt.value());
|
||||
animationsTable->CacheAnimationGroup(groupIdInt.value());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user