summaryrefslogtreecommitdiff
path: root/src/manager/manager6.c
blob: ff32b405758a50a02cd11a1051d6fa6a07e0e32d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "global.h"
#include "player.h"
#include "manager.h"
#include "functions.h"

extern void DoExitTransition(void*);

void sub_08057CB4(Manager6* this) {
    u32 tmp;
    Manager6WarpData* i;
    if (this->manager.action == 0) {
        this->manager.action = 1;
        this->warpList = GetCurrentRoomProperty(this->manager.unk_0a);
        if (!this->warpList) {
            DeleteManager(&this->manager);
            return;
        }
    }
    if (this->manager.unk_0e == 0 || gPlayerState.field_0x10[2] == 0x1e) {
        for (i = this->warpList; i->posX != 0xFFFF; i++) {
            tmp = (i->unk_07.all & 0x3);
            if (((tmp & (gPlayerEntity.collisionLayer)) != 0) &&
                (((gPlayerState.flags.all & 0x80) != 0) || ((i->unk_07.b.unk2) != 0)) &&
                (CheckPlayerInRegion(i->posX, i->posY, i->width, i->height) != 0) &&
                (gPlayerEntity.height.HALF.HI == 0)) {
                DoExitTransition(GetCurrentRoomProperty(i->unk_06));
            }
        }
    }
}