mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
fix(ugc): give old cars and rockets a build id when a character loads
Cars and rockets built before builds were recorded have no subkey and no ugc_modular_build row, so the client has no blueprint id to ask for their icon with. When a character loads, such an item (a ModularBuildComponent createdLOT with assemblyPartLOTs but no subkey) gets what a new build gets: a persistent id as its subkey and a ugc_modular_build row with its modules and owner. The next save keeps the subkey; nothing is dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#include "CDModularBuildComponentTable.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <regex>
|
||||
#include <string>
|
||||
|
||||
@@ -55,3 +57,8 @@ std::optional<CDModularBuildComponent> CDModularBuildComponentTable::FindByNumbe
|
||||
std::optional<CDModularBuildComponent> CDModularBuildComponentTable::GetByNumberOfParts(const uint32_t numberOfParts) const {
|
||||
return FindByNumberOfParts(GetEntries(), numberOfParts);
|
||||
}
|
||||
|
||||
bool CDModularBuildComponentTable::IsCreatedLot(LOT lot) const {
|
||||
const auto& entries = GetEntries();
|
||||
return std::any_of(entries.begin(), entries.end(), [lot](const CDModularBuildComponent& build) { return build.createdLOT == lot; });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user