ufna / VaRest

REST API plugin for Unreal Engine 4 - we love restfull backend and JSON communications!
https://www.unrealengine.com/marketplace/en-US/product/varest-plugin
MIT License
1.08k stars 296 forks source link

GetWorldFromContextObject deprecated #124

Closed danatsh closed 6 years ago

danatsh commented 7 years ago

Hi,

When I building android package I see warning message

UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: In file included from D:/Epic Games/Unreal Projects/Proj/Plugins/VaRestPlugin/Intermediate/Build/Android/UE4/Development/VaRestPlugin/Module.VaRestPlugin.cpp:6:
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: D:\Epic Games\Unreal Projects\Proj\Plugins\VaRestPlugin\Source\VaRestPlugin\Private\VaRestRequestJSON.cpp(228,31) :  warning: 'GetWorldFromContextObject' is deprecated: GetWorldFromContextObject(Object) and GetWorldFromContextObject(Object, boolean) are replaced by GetWorldFromContextObject(Object, Enu
m) or GetWorldFromContextObjectChecked(Object) Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile. [-Wdeprecated-declarations]
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool:         if (UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject))
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool:                                      ^
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: Runtime/Engine/Classes\Engine/Engine.h(2211,10) :  note: 'GetWorldFromContextObject' has been explicitly marked deprecated here
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool:         UWorld* GetWorldFromContextObject(const UObject* Object, bool bChecked = true) const
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool:      

Is there any way to change deprecated function?

JulianuszBarat commented 7 years ago

I have the same problem with Windows Build.(4.18 Engine version)

PlainBane commented 7 years ago

Here are the changes you have to make to fix that warning. Have not tested in full build or on any device. So be careful. Should work though. Repository code Or you can use my forked version of plugin until author releases an official fix. Repository