retrieve a UWorld from a generic UObject (if possible)
| 1192 | |
| 1193 | // retrieve a UWorld from a generic UObject (if possible) |
| 1194 | UWorld *ue_get_uworld(ue_PyUObject *py_obj) { |
| 1195 | |
| 1196 | if (py_obj->ue_object->IsA<UWorld>()) { |
| 1197 | return (UWorld *)py_obj->ue_object; |
| 1198 | } |
| 1199 | |
| 1200 | if (py_obj->ue_object->IsA<AActor>()) { |
| 1201 | AActor *actor = (AActor *)py_obj->ue_object; |
| 1202 | return actor->GetWorld(); |
| 1203 | } |
| 1204 | |
| 1205 | if (py_obj->ue_object->IsA<UActorComponent>()) { |
| 1206 | UActorComponent *component = (UActorComponent *)py_obj->ue_object; |
| 1207 | return component->GetWorld(); |
| 1208 | } |
| 1209 | |
| 1210 | return nullptr; |
| 1211 | } |
| 1212 | |
| 1213 | // retrieve actor from component (if possible) |
| 1214 | AActor *ue_get_actor(ue_PyUObject *py_obj) { |
no outgoing calls
no test coverage detected