Skip to content

Commit 771c18d

Browse files
author
Roberto De Ioris
committed
improved 4.17 compatibility
1 parent acc8306 commit 771c18d

File tree

4 files changed

+52
-36
lines changed

4 files changed

+52
-36
lines changed

Source/PythonConsole/PythonConsole.Build.cs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55

66
public class PythonConsole : ModuleRules
77
{
8-
9-
8+
#if WITH_FORWARDED_MODULE_RULES_CTOR
9+
public PythonConsole(ReadOnlyTargetRules Target) : base(Target)
10+
#else
1011
public PythonConsole(TargetInfo Target)
11-
{
12+
#endif
13+
{
1214
PrivateIncludePaths.AddRange(
1315
new string[] {
1416
"PythonConsole/Private",
@@ -17,19 +19,19 @@ public PythonConsole(TargetInfo Target)
1719
);
1820

1921
PrivateDependencyModuleNames.AddRange(
20-
new string[] {
21-
"Core",
22-
"CoreUObject", // @todo Mac: for some reason it's needed to link in debug on Mac
22+
new string[] {
23+
"Core",
24+
"CoreUObject", // @todo Mac: for some reason it's needed to link in debug on Mac
2325
"Engine",
2426
"InputCore",
25-
"UnrealEd",
26-
"Slate",
27-
"SlateCore",
27+
"UnrealEd",
28+
"Slate",
29+
"SlateCore",
2830
"EditorStyle",
2931
"TargetPlatform",
3032
"UnrealEnginePython"
3133
}
32-
);
34+
);
3335

3436
}
3537
}

Source/PythonEditor/PythonEditor.Build.cs

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,39 @@
22

33
namespace UnrealBuildTool.Rules
44
{
5-
public class PythonEditor : ModuleRules
6-
{
7-
public PythonEditor(TargetInfo Target)
8-
{
9-
PrivateIncludePaths.AddRange(
10-
new string[] {
11-
"PythonEditor/Private",
12-
}
13-
);
5+
public class PythonEditor : ModuleRules
6+
{
7+
#if WITH_FORWARDED_MODULE_RULES_CTOR
8+
public PythonEditor(ReadOnlyTargetRules Target) : base(Target)
9+
#else
10+
public PythonEditor(TargetInfo Target)
11+
#endif
12+
{
13+
PrivateIncludePaths.AddRange(
14+
new string[] {
15+
"PythonEditor/Private",
16+
}
17+
);
1418

15-
PrivateDependencyModuleNames.AddRange(
16-
new string[]
17-
{
18-
"Core",
19-
"CoreUObject",
20-
"SlateCore",
21-
"Slate",
22-
"AssetTools",
23-
"UnrealEd",
24-
"EditorStyle",
25-
"PropertyEditor",
26-
"Kismet", // for FWorkflowCentricApplication
19+
PrivateDependencyModuleNames.AddRange(
20+
new string[]
21+
{
22+
"Core",
23+
"CoreUObject",
24+
"SlateCore",
25+
"Slate",
26+
"AssetTools",
27+
"UnrealEd",
28+
"EditorStyle",
29+
"PropertyEditor",
30+
"Kismet", // for FWorkflowCentricApplication
2731
"InputCore",
28-
"DirectoryWatcher",
29-
"LevelEditor",
32+
"DirectoryWatcher",
33+
"LevelEditor",
3034
"Projects",
3135
"UnrealEnginePython"
3236
}
33-
);
34-
}
35-
}
37+
);
38+
}
39+
}
3640
}

Source/UnrealEnginePython/Private/UObject/UEPyActor.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,14 @@ PyObject *py_ue_actor_destroy_component(ue_PyUObject * self, PyObject * args) {
106106
}
107107

108108
UActorComponent *component = ue_py_check_type<UActorComponent>(py_component);
109+
if (!component)
110+
return PyErr_Format(PyExc_Exception, "argument is not a UActorComponent");
109111

112+
#if ENGINE_MINOR_VERSION >= 17
113+
component->DestroyComponent();
114+
#else
110115
actor->K2_DestroyComponent(component);
116+
#endif
111117

112118
Py_INCREF(Py_None);
113119
return Py_None;

Source/UnrealEnginePython/UnrealEnginePython.Build.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ public class UnrealEnginePython : ModuleRules
7070
"/usr/lib/x86_64-linux-gnu/libpython2.7.so",
7171
};
7272

73+
#if WITH_FORWARDED_MODULE_RULES_CTOR
74+
public UnrealEnginePython(ReadOnlyTargetRules Target) : base(Target)
75+
#else
7376
public UnrealEnginePython(TargetInfo Target)
77+
#endif
7478
{
7579

7680
PublicIncludePaths.AddRange(

0 commit comments

Comments
 (0)