From 5c9188aaca8ee24c21510251c27ae507e78314e0 Mon Sep 17 00:00:00 2001 From: Amethyst-szs Date: Tue, 12 Jul 2022 12:53:24 -0700 Subject: [PATCH] Fixed cappy infinite height --- include/game/Player/HackCap.h | 7 +++-- .../Player/HackCap/PlayerCapActionHistory.h | 29 +++++++++++++++++++ source/timeWarp.cpp | 6 ++++ 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 include/game/Player/HackCap/PlayerCapActionHistory.h diff --git a/include/game/Player/HackCap.h b/include/game/Player/HackCap.h index eb7fa57..eccc2d5 100644 --- a/include/game/Player/HackCap.h +++ b/include/game/Player/HackCap.h @@ -14,9 +14,9 @@ #include "HackCapThrowParam.h" #include "HackCap/HackCapJointControlKeeper.h" +#include "HackCap/PlayerCapActionHistory.h" class PlayerWallActionHistory; -class PlayerCapActionHistory; class PlayerEyeSensorHitHolder; class IUsePlayerHeightCheck; class PlayerWetControl; @@ -201,6 +201,9 @@ class HackCap : public al::LiveActor { al::LiveActor *mCapEyes; // 0x120 PlayerActorHakoniwa *mPlayerActor; // 0x128 unsigned char padding_220[0x220-0x130]; - HackCapThrowParam throwParam; // 0x220 + HackCapThrowParam *throwParam; // 0x220 + unsigned char padding_2B8[0x2B8-0x228]; + PlayerCapActionHistory *mCapActionHistory; // 0x2B8 + unsigned char padding_2E0[0x2E0-0x2C0]; HackCapJointControlKeeper *mJointKeeper; // 0x2E0 }; \ No newline at end of file diff --git a/include/game/Player/HackCap/PlayerCapActionHistory.h b/include/game/Player/HackCap/PlayerCapActionHistory.h new file mode 100644 index 0000000..979bd66 --- /dev/null +++ b/include/game/Player/HackCap/PlayerCapActionHistory.h @@ -0,0 +1,29 @@ +#pragma once + +#include "al/LiveActor/LiveActor.h" +#include "game/Interfaces/IUsePlayerCollision.h" +#include "game/Player/PlayerConst.h" +#include "math/seadVector.h" + +class PlayerCapActionHistory { +public: + PlayerCapActionHistory(al::LiveActor const*,PlayerConst const*,struct PlayerTrigger const*,IUsePlayerCollision const*); + void update(void); + void clearLandLimit(void); + void clearLimitHeight(void); + void clearCapJump(void); + void clearLandLimitStandAngle(void); + void clearWallAirLimit(void); + void recordLimitHeight(void); + bool isOverLimitHeight(void) const; + + al::LiveActor* mHostActor; // 0x0 + PlayerConst* mPlayerConst; // 0x8 + PlayerTrigger* mPlayerTrigger; // 0x10 + IUsePlayerCollision* mCollider; // 0x18 + struct PlayerCounterAfterCapCatch* mCapCatchCounter; // 0x20 + bool mIsCapBounced = false; // 0x28 + sead::Vector3f mUnkVec = sead::Vector3f::zero; // 0x2C + bool mIsCapJumpReady = true; // 0x38 + bool mIsLimited = true; // 0x39 (unsure what this actually is called) +}; \ No newline at end of file diff --git a/source/timeWarp.cpp b/source/timeWarp.cpp index b296fe4..6b14e0f 100644 --- a/source/timeWarp.cpp +++ b/source/timeWarp.cpp @@ -243,6 +243,12 @@ void TimeContainer::endRewind(PlayerActorHakoniwa* p1) p1->mHackCap->forcePutOn(); p1->mHackCap->hidePuppetCap(); } + + if(GameDataFunction::isEnableCap(stageSceneRef)){ + if(p1->mHackCap){ + p1->mHackCap->mCapActionHistory->mIsCapJumpReady = false; + } + } isRewinding = false; resetCooldown();