summaryrefslogtreecommitdiff
path: root/src/object/objectA.c
blob: 0e63b26f942bb9cb53cd0fe392445b994d2c1a56 (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
31
32
33
34
35
36
37
38
39
40
#include "global.h"
#include "entity.h"
#include "room.h"
#include "flags.h"
#include "createObject.h"
#include "functions.h"

extern Hitbox gUnk_080FD170;

extern u8 gUnk_02000070;

void ObjectA(Entity* this) {
    u32 uVar2;

    if (this->action == 0) {
        this->action = 1;
        this->hitbox = &gUnk_080FD170;
        if (this->collisionLayer == 1) {
            uVar2 = 0x26;
        } else {
            uVar2 = 0x34;
        }
        this->field_0x70.HALF.LO = uVar2;
        if (CheckFlags(this->field_0x86.HWORD) != 0) {
            SetTileType(*(u16*)&this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
            if ((gRoomControls.unk2 & 1) != 0) {
                gUnk_02000070 = 0;
            }
            DeleteThisEntity();
        } else {
            sub_080787CC(this);
        }
    } else if (this->interactType != 0) {
        SetTileType(*(u16*)&this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
        SetFlag(this->field_0x86.HWORD);
        CreateDust(this);
        sub_080526F8(-1);
        DeleteThisEntity();
    }
}