Skip to content

Commit

Permalink
Merge branch 'main' into enemy-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pish-pish authored Nov 11, 2024
2 parents 43ac062 + 87b87f0 commit bc07244
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 2 additions & 0 deletions include/JSystem/JUtility/JUTGamePad.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ struct JUTGamePad : public JKRDisposer {
PRESS_DOWN = (PRESS_DPAD_DOWN | ANALOG_DOWN),
PRESS_UP = (PRESS_DPAD_UP | ANALOG_UP),

PRESS_ABX = (PRESS_A | PRESS_B | PRESS_X),
PRESS_ABXY = (PRESS_A | PRESS_B | PRESS_X | PRESS_Y),
PRESS_ABXYLRZ = (PRESS_A | PRESS_B | PRESS_X | PRESS_Y | PRESS_L | PRESS_R | PRESS_Z),
};

Expand Down
13 changes: 5 additions & 8 deletions src/plugProjectKandoU/gameCaveInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void TekiInfo::read(Stream& stream)
}

parsedBuffer[0] = '\0';
char* parsedString = parsedBuffer;
char* parsedString = inputBuffer;
int parsedVarIndex = 0;
u32 parsedIntValue = 0;
char* inputPtr = inputString;
Expand All @@ -91,25 +91,23 @@ void TekiInfo::read(Stream& stream)
bool isUnderscore = false;

if (*inputPtr == '_') {
if (parsedString == parsedBuffer) {
if (parsedString == inputBuffer) {
parsedString[parsedVarIndex] = '\0';
EnemyInfo* enemyInfoPtr = gEnemyInfo;
int enemyIndex = 0;

while (gEnemyInfoNum > enemyIndex) {
if (strcmp(enemyInfoPtr->mName, parsedString) == 0) {
if (strcmp(gEnemyInfo[enemyIndex].mName, parsedString) == 0) {
isUnderscore = true;
break;
}

enemyInfoPtr++;
enemyIndex++;
}
}
}

if (isUnderscore) {
parsedString = inputBuffer;
parsedString = parsedBuffer;
parsedVarIndex = 0;
} else {
parsedString[parsedVarIndex] = *inputPtr;
Expand All @@ -120,7 +118,7 @@ void TekiInfo::read(Stream& stream)
inputPtr++;
}
parsedString[parsedVarIndex] = '\0';
mEnemyID = static_cast<EnemyTypeID::EEnemyTypeID>(generalEnemyMgr->getEnemyID(parsedBuffer, EFlag_CanBeSpawned));
mEnemyID = static_cast<EnemyTypeID::EEnemyTypeID>(generalEnemyMgr->getEnemyID(inputBuffer, EFlag_CanBeSpawned));

if (parsedBuffer[0] != '\0') {
pelletMgr->makeOtakaraItemCode(parsedBuffer, mOtakaraItemCode);
Expand All @@ -131,7 +129,6 @@ void TekiInfo::read(Stream& stream)
mType = static_cast<BaseGen::CaveGenType>(stream.readInt());
inputPtr = generalEnemyMgr->getEnemyName(mEnemyID, EFlag_CanBeSpawned);
mName = inputPtr;
return;

/*
.loc_0x0:
Expand Down
2 changes: 1 addition & 1 deletion src/plugProjectKandoU/naviState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6064,7 +6064,7 @@ void NaviPelletState::exec(Navi* navi)

if (mState == 1 || mState == 0) {
if (navi->mController1
&& navi->mController1->getButtonDown() & (Controller::PRESS_Z | Controller::PRESS_R | Controller::PRESS_L)) {
&& navi->mController1->isButtonDown(Controller::PRESS_ABX | Controller::PRESS_DPAD)) {
if (mDoForceWakeup) {
navi->mAnimSpeed = 60.0f;
navi->finishMotion();
Expand Down

0 comments on commit bc07244

Please sign in to comment.