diff --git a/asm/main_0205D1F4.s b/asm/main_0205D1F4.s index a1dae6a7..84724730 100644 --- a/asm/main_0205D1F4.s +++ b/asm/main_0205D1F4.s @@ -3,24 +3,6 @@ .text - arm_func_start sub_0205D1F4 -sub_0205D1F4: ; 0x0205D1F4 - stmdb sp!, {r4, lr} - mov r4, r0 - bl IsMissionValid - cmp r0, #0 - beq _0205D214 - ldrb r0, [r4] - cmp r0, #9 - blo _0205D21C -_0205D214: - mov r0, #0 - ldmia sp!, {r4, pc} -_0205D21C: - mov r0, #1 - ldmia sp!, {r4, pc} - arm_func_end sub_0205D1F4 - arm_func_start GenerateMission GenerateMission: ; 0x0205D224 stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr} diff --git a/include/main_0205D11C.h b/include/main_0205D11C.h index fd263e1c..7a0adb86 100644 --- a/include/main_0205D11C.h +++ b/include/main_0205D11C.h @@ -2,7 +2,9 @@ #define PMDSKY_MAIN_0205D11C_H #include "util.h" +#include "mission.h" bool8 sub_0205D11C(u32 r0, u32 r1, s16 r2); +bool8 sub_0205D1F4(struct mission *mission); #endif //PMDSKY_MAIN_0205D11C_H diff --git a/include/mission.h b/include/mission.h index d4b25280..983153ec 100644 --- a/include/mission.h +++ b/include/mission.h @@ -15,6 +15,7 @@ enum mission_status { MISSION_STATUS_DONE = 6, MISSION_STATUS_UNK_7 = 7, // Shows up as "accepted" MISSION_STATUS_UNK_8 = 8, // Shows up as "accepted" + NUM_MISSIONS_STATUS }; // Different types of rewards that a mission can have diff --git a/src/main_0205D11C.c b/src/main_0205D11C.c index e1ab3f58..75a53875 100644 --- a/src/main_0205D11C.c +++ b/src/main_0205D11C.c @@ -9,6 +9,8 @@ extern const char _020A3AF4[]; extern const char _020A3B18[]; extern bool8 IsItemValidVeneer(s16 item_id); +extern bool8 IsMissionValid(struct mission *mission); + bool8 sub_0205D11C(u32 r0, u32 r1, s16 r2) { @@ -39,3 +41,10 @@ bool8 sub_0205D11C(u32 r0, u32 r1, s16 r2) Debug_Print0(_020A3B18, r2); return FALSE; } + +bool8 sub_0205D1F4(struct mission *mission) { + if (!IsMissionValid(mission) || ((mission->status >= NUM_MISSIONS_STATUS))) { + return FALSE; + } + return TRUE; +}