Skip to content

Commit

Permalink
feat: Add IsSpaceshipLanded and GetLocationFromCoordinates (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
TommInfinite authored Oct 8, 2023
1 parent 914ee05 commit fdb604c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions CommonLibSF/include/RE/T/TESObjectREFR.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ namespace RE
[[nodiscard]] bool IsCrimeToActivate();
[[nodiscard]] bool IsInSpace(bool a_arg1);
[[nodiscard]] bool IsSpaceshipDocked();
[[nodiscard]] bool IsSpaceshipLanded();

// members
OBJ_REFR data; // 0A0
Expand Down
6 changes: 6 additions & 0 deletions CommonLibSF/include/RE/T/TESWorldSpace.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@

#include "RE/T/TESForm.h"
#include "RE/T/TESFullName.h"
#include "RE/N/NiPoint3.h"

namespace RE
{
class BGSLocation;
class TESWorldSpace :
public TESForm, // 00
public TESFullName // 20
{
public:
SF_FORMTYPE(WRLD);

[[nodiscard]] BGSLocation* GetLocationFromCoordinates(NiPoint3A& a_coordinates);

//
};
}
7 changes: 7 additions & 0 deletions CommonLibSF/src/RE/T/TESObjectREFR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,11 @@ namespace RE
return func(this);
}

bool TESObjectREFR::IsSpaceshipLanded()
{
using func_t = decltype(&TESObjectREFR::IsSpaceshipLanded);
REL::Relocation<func_t> func{ REL::ID(173880) };
return func(this);
}

}
11 changes: 11 additions & 0 deletions CommonLibSF/src/RE/T/TESWorldSpace.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "RE/T/TESWorldSpace.h"

namespace RE
{
BGSLocation* TESWorldSpace::GetLocationFromCoordinates(NiPoint3A& a_coordinates)
{
using func_t = decltype(&TESWorldSpace::GetLocationFromCoordinates);
REL::Relocation<func_t> func{ REL::ID(107914) };
return func(this, a_coordinates);
}
}

0 comments on commit fdb604c

Please sign in to comment.