Skip to content

Commit

Permalink
Add Simulator::GetPlayerHomePlanet() and cEmpire::RequireHomePlanet()
Browse files Browse the repository at this point in the history
  • Loading branch information
emd4600 committed Sep 19, 2024
1 parent 3c1fd8a commit ef40d11
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ namespace Addresses(Simulator)

DefineAddress(GetMainSpeciesImageKey, SelectAddress(0x1066AF0, 0x1065F10));

DefineAddress(GetPlayerHomePlanet, SelectAddress(0x10223F0, 0x1021220));

#ifndef SDK_TO_GHIDRA
DefineAddress(LightingWorld_ptr, SelectAddress(0x1682CD4, 0x167EA54));
DefineAddress(PrecalculatedSolarStarRadius_ptr, SelectAddress(0x157DCF0, 0x1579D10));
Expand Down Expand Up @@ -326,6 +328,7 @@ namespace Simulator
DefineAddress(CaptureSystem, SelectAddress(0xC8C320, 0xC8D190));
DefineAddress(UpdateAndGetColor, SelectAddress(0xC325F0, 0xC32E30));
DefineAddress(AddStarOwnership, SelectAddress(0xC33AB0, 0xC34300));
DefineAddress(RequireHomePlanet, SelectAddress(0xC30F90, 0xC31890));
}

namespace Addresses(cEnergyRepairToolStrategy)
Expand Down
2 changes: 2 additions & 0 deletions Spore ModAPI/SourceCode/Simulator/SpacePlayerData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@ namespace Simulator
auto_STATIC_METHOD_(Simulator, uint32_t, GetPlayerEmpireID);

auto_STATIC_METHOD_(Simulator, SpaceContext, GetCurrentContext);

auto_STATIC_METHOD_(Simulator, cPlanetRecord*, GetPlayerHomePlanet);
}
#endif
2 changes: 2 additions & 0 deletions Spore ModAPI/SourceCode/Simulator/cEmpire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ namespace Simulator
auto_METHOD_(cEmpire, cSpeciesProfile*, GetSpeciesProfile);
auto_METHOD_VOID(cEmpire, SetSpeciesProfile, Args(cSpeciesProfile* pSpecies), Args(pSpecies));

auto_METHOD_(cEmpire, cPlanetRecord*, RequireHomePlanet);

cStarRecord* cEmpire::GetHomeStarRecord() {
if (mHomeStar.internalValue != -1) {
return StarManager.GetStarRecord(mHomeStar);
Expand Down
3 changes: 3 additions & 0 deletions Spore ModAPI/Spore/Simulator/SubSystem/SpacePlayerData.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ namespace Simulator

SpaceContext GetCurrentContext();

cPlanetRecord* GetPlayerHomePlanet();

class SpacePlayerData
{
public:
Expand Down Expand Up @@ -73,4 +75,5 @@ namespace Addresses(Simulator)

DeclareAddress(GetCurrentContext);

DeclareAddress(GetPlayerHomePlanet); // 0x10223F0 0x1021220
}
6 changes: 5 additions & 1 deletion Spore ModAPI/Spore/Simulator/cEmpire.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ namespace Simulator

cStarRecord* GetHomeStarRecord();

/// Returns the home planet of the empire, and if it is not available, it assigns one.
/// Preferrable over using `mHomePlanet`
cPlanetRecord* RequireHomePlanet();

cSpeciesProfile* GetSpeciesProfile();

void SetSpeciesProfile(cSpeciesProfile* pSpecies);
Expand Down Expand Up @@ -136,7 +140,7 @@ namespace Simulator
DeclareAddress(CaptureSystem);
DeclareAddress(UpdateAndGetColor); // 0xC325F0 0xC32E30
DeclareAddress(AddStarOwnership); // 0xC33AB0 0xC34300
//TODO sub_C30F90 RequireHomePlanet
DeclareAddress(RequireHomePlanet); // 0xC30F90 0xC31890
}

}
Expand Down

0 comments on commit ef40d11

Please sign in to comment.