diff options
| author | Léo Lam <leo@leolam.fr> | 2021-11-24 01:59:32 +0100 |
|---|---|---|
| committer | Léo Lam <leo@leolam.fr> | 2021-11-24 02:00:49 +0100 |
| commit | c0a79e67eeb8bc7f41889cc0fc9ea1808cf6341e (patch) | |
| tree | 48dce368a923554d507f6179cb1a14cc875e633f /src | |
| parent | 022f029db1ef03d900fb54bad0807939c9695720 (diff) | |
ksys: Merge EcoUtil into ActorUtil
The "is in Satori mountain area" function actually appears to be part
of ActorUtil (which contains a bunch of actor-related helper functions)
Diffstat (limited to 'src')
| -rw-r--r-- | src/KingSystem/ActorSystem/actActorUtil.cpp | 5 | ||||
| -rw-r--r-- | src/KingSystem/ActorSystem/actActorUtil.h | 2 | ||||
| -rw-r--r-- | src/KingSystem/Ecosystem/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/KingSystem/Ecosystem/ecoUtil.cpp | 9 | ||||
| -rw-r--r-- | src/KingSystem/Ecosystem/ecoUtil.h | 10 | ||||
| -rw-r--r-- | src/KingSystem/World/worldTimeMgr.cpp | 6 |
6 files changed, 10 insertions, 24 deletions
diff --git a/src/KingSystem/ActorSystem/actActorUtil.cpp b/src/KingSystem/ActorSystem/actActorUtil.cpp index 75de3637..95062d8e 100644 --- a/src/KingSystem/ActorSystem/actActorUtil.cpp +++ b/src/KingSystem/ActorSystem/actActorUtil.cpp @@ -8,6 +8,7 @@ #include "KingSystem/ActorSystem/actBaseProcLink.h" #include "KingSystem/ActorSystem/actInfoData.h" #include "KingSystem/ActorSystem/actTag.h" +#include "KingSystem/Ecosystem/ecoSystem.h" #include "KingSystem/GameData/gdtManager.h" #include "KingSystem/Map/mapObject.h" #include "KingSystem/Map/mapPlacementMgr.h" @@ -585,4 +586,8 @@ bool getSameGroupActorName(sead::SafeString* name, const sead::SafeString& actor return true; } +bool isInSatoriMountainArea(const sead::Vector3f& pos) { + return eco::Ecosystem::instance()->getFieldMapArea(pos.x, pos.z) == 64; +} + } // namespace ksys::act diff --git a/src/KingSystem/ActorSystem/actActorUtil.h b/src/KingSystem/ActorSystem/actActorUtil.h index cc642e99..e940f301 100644 --- a/src/KingSystem/ActorSystem/actActorUtil.h +++ b/src/KingSystem/ActorSystem/actActorUtil.h @@ -167,4 +167,6 @@ bool getSameGroupActorName(sead::SafeString* name, const sead::SafeString& actor s32 getSelectedChoiceIdx(s32 max, const char* query_name); +bool isInSatoriMountainArea(const sead::Vector3f& pos); + } // namespace ksys::act diff --git a/src/KingSystem/Ecosystem/CMakeLists.txt b/src/KingSystem/Ecosystem/CMakeLists.txt index f45f7d24..5da05cec 100644 --- a/src/KingSystem/Ecosystem/CMakeLists.txt +++ b/src/KingSystem/Ecosystem/CMakeLists.txt @@ -3,6 +3,4 @@ target_sources(uking PRIVATE ecoLevelSensor.h ecoSystem.cpp ecoSystem.h - ecoUtil.cpp - ecoUtil.h ) diff --git a/src/KingSystem/Ecosystem/ecoUtil.cpp b/src/KingSystem/Ecosystem/ecoUtil.cpp deleted file mode 100644 index 6ee2731e..00000000 --- a/src/KingSystem/Ecosystem/ecoUtil.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "KingSystem/Ecosystem/ecoUtil.h" - -namespace ksys::eco { - -bool currentAreaNumIs64(const sead::Vector3f& pos) { - return Ecosystem::instance()->getFieldMapArea(pos.x, pos.z) == 64; -} - -} // namespace ksys::eco diff --git a/src/KingSystem/Ecosystem/ecoUtil.h b/src/KingSystem/Ecosystem/ecoUtil.h deleted file mode 100644 index 225e2de4..00000000 --- a/src/KingSystem/Ecosystem/ecoUtil.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include <math/seadVector.h> -#include "KingSystem/Ecosystem/ecoSystem.h" - -namespace ksys::eco { - -bool currentAreaNumIs64(const sead::Vector3f& pos); - -} // namespace ksys::eco diff --git a/src/KingSystem/World/worldTimeMgr.cpp b/src/KingSystem/World/worldTimeMgr.cpp index 0deb6fb6..1c2b5a40 100644 --- a/src/KingSystem/World/worldTimeMgr.cpp +++ b/src/KingSystem/World/worldTimeMgr.cpp @@ -2,7 +2,7 @@ #include <random/seadGlobalRandom.h> #include "KingSystem/ActorSystem/actActorConstDataAccess.h" #include "KingSystem/ActorSystem/actActorSystem.h" -#include "KingSystem/Ecosystem/ecoUtil.h" +#include "KingSystem/ActorSystem/actActorUtil.h" #include "KingSystem/Event/evtManager.h" #include "KingSystem/Event/evtMetadata.h" #include "KingSystem/GameData/gdtManager.h" @@ -590,7 +590,7 @@ void TimeMgr::AnimalMasterController::calc() { if (!player_accessor.hasProc()) break; - if (eco::currentAreaNumIs64(player_accessor.getPreviousPos())) + if (act::isInSatoriMountainArea(player_accessor.getPreviousPos())) break; appearance_hour = sead::GlobalRandom::instance()->getU32(23); @@ -602,7 +602,7 @@ void TimeMgr::AnimalMasterController::calc() { if (!player_accessor.hasProc()) break; - if (eco::currentAreaNumIs64(player_accessor.getPreviousPos())) { + if (act::isInSatoriMountainArea(player_accessor.getPreviousPos())) { state = 0; break; } |
