summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2020-11-08 23:03:22 +0100
committerLéo Lam <leo@leolam.fr>2020-11-08 23:04:14 +0100
commitb28ba7b3adcda445a63d617c8cb0691d404130d6 (patch)
tree3090ca4a4da6bdf6e08f152de2a54e6387b5672c /src
parentcb5976d8aefb2b03d9cb48dfa28c2dc7142020a1 (diff)
ksys/act: Add Actor::getMaxLife and fix encapsulation
Diffstat (limited to 'src')
-rw-r--r--src/KingSystem/ActorSystem/actActor.h5
-rw-r--r--src/KingSystem/ActorSystem/actActorCaptureMgr.cpp2
-rw-r--r--src/KingSystem/Damage/dmgDamageManagerBase.cpp2
3 files changed, 7 insertions, 2 deletions
diff --git a/src/KingSystem/ActorSystem/actActor.h b/src/KingSystem/ActorSystem/actActor.h
index cb33476c..83315c02 100644
--- a/src/KingSystem/ActorSystem/actActor.h
+++ b/src/KingSystem/ActorSystem/actActor.h
@@ -16,6 +16,10 @@ public:
SEAD_RTTI_OVERRIDE(Actor, BaseProc)
+ const ActorParam* getParam() const { return mActorParam; }
+
+ virtual s32 getMaxLife();
+
virtual LifeRecoverInfo* getLifeRecoverInfo();
void emitBasicSigOn();
@@ -23,6 +27,7 @@ public:
void nullsub_4649(); // Some kind of logging which has been excluded from the build?
+protected:
u8 TEMP1[0x3F4]; // FIXME
ActorParam* mActorParam;
u8 TEMP2[0x2C0]; // FIXME
diff --git a/src/KingSystem/ActorSystem/actActorCaptureMgr.cpp b/src/KingSystem/ActorSystem/actActorCaptureMgr.cpp
index e1a530b5..32f1525b 100644
--- a/src/KingSystem/ActorSystem/actActorCaptureMgr.cpp
+++ b/src/KingSystem/ActorSystem/actActorCaptureMgr.cpp
@@ -36,7 +36,7 @@ void ActorCaptureMgr::setCamera(Camera* camera) {
}
void ActorCaptureMgr::loadCaptureParam() {
- if (!mActor || !mActor->mActorParam)
+ if (!mActor || !mActor->getParam())
return;
const char* name = getCapturedActorName();
diff --git a/src/KingSystem/Damage/dmgDamageManagerBase.cpp b/src/KingSystem/Damage/dmgDamageManagerBase.cpp
index 8fc37c54..76c82d15 100644
--- a/src/KingSystem/Damage/dmgDamageManagerBase.cpp
+++ b/src/KingSystem/Damage/dmgDamageManagerBase.cpp
@@ -104,7 +104,7 @@ void DamageManagerBase::removeDamageCallback(DamageCallback* callback) {
}
bool DamageManagerBase::applyDamage(s32& life) {
- auto* param_list = mActor->mActorParam->getRes().mGParamList;
+ auto* param_list = mActor->getParam()->getRes().mGParamList;
const res::GParamListObjectGeneral& params = param_list->getGeneral();
if (params.mIsLifeInfinite.ref()) {