mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Fix used extension check false positive from usused object or behavior events (#7331)
- Don't show in changelog
This commit is contained in:
@@ -69,9 +69,16 @@ bool UsedExtensionsFinder::DoVisitInstruction(gd::Instruction& instruction,
|
||||
project.GetCurrentPlatform(), instruction.GetType())
|
||||
: gd::MetadataProvider::GetExtensionAndActionMetadata(
|
||||
project.GetCurrentPlatform(), instruction.GetType());
|
||||
result.AddUsedExtension(metadata.GetExtension());
|
||||
for (auto&& includeFile : metadata.GetMetadata().GetIncludeFiles()) {
|
||||
result.AddUsedIncludeFiles(includeFile);
|
||||
// Unused event-based objects or events-based behaviors may use object and
|
||||
// behavior instructions that should not be detected as extension usage.
|
||||
// The extension of actually used objects and behaviors will be detected on
|
||||
// scene objects. This is why object or behavior instructions usually don't
|
||||
// have any import.
|
||||
if (!metadata.GetMetadata().GetIncludeFiles().empty()) {
|
||||
result.AddUsedExtension(metadata.GetExtension());
|
||||
for (auto &&includeFile : metadata.GetMetadata().GetIncludeFiles()) {
|
||||
result.AddUsedIncludeFiles(includeFile);
|
||||
}
|
||||
}
|
||||
|
||||
gd::ParameterMetadataTools::IterateOverParameters(
|
||||
@@ -199,9 +206,16 @@ void UsedExtensionsFinder::OnVisitFunctionCallNode(FunctionCallNode& node) {
|
||||
return;
|
||||
}
|
||||
|
||||
result.AddUsedExtension(metadata.GetExtension());
|
||||
for (auto&& includeFile : metadata.GetMetadata().GetIncludeFiles()) {
|
||||
result.AddUsedIncludeFiles(includeFile);
|
||||
// Unused event-based objects or events-based behaviors may use object and
|
||||
// behavior expressions that should not be detected as extension usage.
|
||||
// The extension of actually used objects and behaviors will be detected on
|
||||
// scene objects. This is why object or behavior expressions usually don't
|
||||
// have any import.
|
||||
if (!metadata.GetMetadata().GetIncludeFiles().empty()) {
|
||||
result.AddUsedExtension(metadata.GetExtension());
|
||||
for (auto &&includeFile : metadata.GetMetadata().GetIncludeFiles()) {
|
||||
result.AddUsedIncludeFiles(includeFile);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user