Browse Source

Add workaround for loading save when entity was moved to another mod

Ivan Savenko 4 tháng trước cách đây
mục cha
commit
03997a800a
1 tập tin đã thay đổi với 10 bổ sung0 xóa
  1. 10 0
      lib/constants/EntityIdentifiers.cpp

+ 10 - 0
lib/constants/EntityIdentifiers.cpp

@@ -158,6 +158,16 @@ int32_t IdentifierBase::resolveIdentifier(const std::string & entityType, const
 
 
 	if (rawId)
 	if (rawId)
 		return rawId.value();
 		return rawId.value();
+
+	size_t semicolon = identifier.find(':');
+
+	if (semicolon != std::string::npos)
+	{
+		auto rawId2 = LIBRARY->identifiers()->getIdentifier(ModScope::scopeGame(), entityType, identifier.substr(semicolon + 1));
+		if (rawId2)
+			return rawId2.value();
+	}
+
 	throw IdentifierResolutionException(identifier);
 	throw IdentifierResolutionException(identifier);
 }
 }