mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 05:25:14 +00:00
Some fixes for some small bugs (#351)
- Doors now no longer will be repeatedly talked even if you don't move away. It now behaves closer to vanilla. - Fixed the ending level name not being able to be replaced.
This commit is contained in:
parent
c97f2dd033
commit
260a429285
2 changed files with 15 additions and 21 deletions
|
@ -88,7 +88,6 @@ static u32 sBackwardKnockbackActions[][3] = {
|
|||
};
|
||||
|
||||
static u8 sDisplayingDoorText = FALSE;
|
||||
static u8 sCanInteractDoor = TRUE;
|
||||
static u8 sJustTeleported = FALSE;
|
||||
u8 gPssSlideStarted = FALSE;
|
||||
extern u8 gLastCollectedStarOrKey;
|
||||
|
@ -1048,7 +1047,7 @@ u32 interact_warp(struct MarioState *m, UNUSED u32 interactType, struct Object *
|
|||
u32 display_door_dialog(struct MarioState *m, u32 actionArg) {
|
||||
if (!m) { return FALSE; }
|
||||
if (m != &gMarioStates[0]) { return FALSE; }
|
||||
return sCanInteractDoor ? set_mario_action(m, ACT_READING_AUTOMATIC_DIALOG, actionArg) : FALSE;
|
||||
return (!sDisplayingDoorText) ? set_mario_action(m, ACT_READING_AUTOMATIC_DIALOG, actionArg) : FALSE;
|
||||
}
|
||||
|
||||
u8 prevent_interact_door(struct MarioState* m, struct Object* o) {
|
||||
|
@ -1082,7 +1081,6 @@ u32 interact_warp_door(struct MarioState *m, UNUSED u32 interactType, struct Obj
|
|||
if (!(saveFlags & SAVE_FLAG_HAVE_KEY_2)) {
|
||||
if (display_door_dialog(m, (saveFlags & SAVE_FLAG_HAVE_KEY_1) ? gBehaviorValues.dialogs.KeyDoor1HaveDialog : gBehaviorValues.dialogs.KeyDoor1DontHaveDialog)) {
|
||||
sDisplayingDoorText = TRUE;
|
||||
sCanInteractDoor = FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -1094,7 +1092,6 @@ u32 interact_warp_door(struct MarioState *m, UNUSED u32 interactType, struct Obj
|
|||
if (!(saveFlags & SAVE_FLAG_HAVE_KEY_1)) {
|
||||
if (display_door_dialog(m, (saveFlags & SAVE_FLAG_HAVE_KEY_2) ? gBehaviorValues.dialogs.KeyDoor2HaveDialog : gBehaviorValues.dialogs.KeyDoor2DontHaveDialog)) {
|
||||
sDisplayingDoorText = TRUE;
|
||||
sCanInteractDoor = FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -1225,16 +1222,8 @@ u32 interact_door(struct MarioState *m, UNUSED u32 interactType, struct Object *
|
|||
|
||||
text += requiredNumStars - numStars;
|
||||
|
||||
if ((requiredNumStars == 70) || display_door_dialog(m, text)) {
|
||||
if (requiredNumStars == 70) {
|
||||
m->interactObj = o;
|
||||
m->usedObj = o;
|
||||
set_mario_action(m, ACT_ENTERING_STAR_DOOR, should_push_or_pull_door(m, o));
|
||||
}
|
||||
sDisplayingDoorText = TRUE;
|
||||
sCanInteractDoor = FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
return set_mario_action(m, ACT_READING_AUTOMATIC_DIALOG, text);
|
||||
}
|
||||
} else if (m->action == ACT_IDLE && sDisplayingDoorText == TRUE && requiredNumStars == 70) {
|
||||
m->interactObj = o;
|
||||
|
@ -2322,13 +2311,12 @@ void mario_process_interactions(struct MarioState *m) {
|
|||
check_kick_or_punch_wall(m);
|
||||
m->flags &= ~MARIO_PUNCHING & ~MARIO_KICKING & ~MARIO_TRIPPING;
|
||||
|
||||
// limit to only local mario
|
||||
if (m == &gMarioStates[0]) {
|
||||
if (!(m->marioObj->collidedObjInteractTypes & (INTERACT_WARP_DOOR | INTERACT_DOOR))) {
|
||||
sDisplayingDoorText = FALSE;
|
||||
sCanInteractDoor = TRUE;
|
||||
}
|
||||
if (!(m->marioObj->collidedObjInteractTypes & INTERACT_WARP)) {
|
||||
if (m == &gMarioStates[0]) {
|
||||
// limit to only local mario
|
||||
sJustTeleported = FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -272,6 +272,7 @@ void smlua_text_utils_act_name_reset(s16 courseNum, u8 actNum) {
|
|||
|
||||
void smlua_text_utils_secret_star_replace(s16 courseNum, const char* courseName) {
|
||||
if (courseNum <= COURSE_RR || courseNum > COURSE_COUNT) { return; }
|
||||
/*
|
||||
s16 courseOffset = courseNum - 1;
|
||||
|
||||
void **courseNameTbl = get_course_name_table();
|
||||
|
@ -282,6 +283,11 @@ void smlua_text_utils_secret_star_replace(s16 courseNum, const char* courseName)
|
|||
|
||||
courseNameTbl[courseOffset] = smlua_text_utils_convert(courseName);
|
||||
sReplacedCourseName[courseOffset] = true;
|
||||
*/
|
||||
|
||||
struct CourseName* courseActNames = gReplacedActNameTable[courseNum];
|
||||
snprintf(courseActNames->name, 256, "%s", courseName + 3);
|
||||
courseActNames->modIndex = gLuaActiveMod->index;
|
||||
}
|
||||
|
||||
void smlua_text_utils_castle_secret_stars_replace(const char* name) {
|
||||
|
|
Loading…
Reference in a new issue