summaryrefslogtreecommitdiff
path: root/src/object/well.c
blob: 86710ac64c68fc123a6be1d5be9ea0f738843e57 (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
#include "global.h"
#include "entity.h"
#include "room.h"
#include "player.h"
#include "functions.h"

extern void (*gUnk_08124C08[])(Entity*);

void Well(Entity* ent) {
    gUnk_08124C08[ent->action](ent);
}

void sub_080A0EB0(Entity* ent) {
    u32 tilePos;

    ent->action = 1;
    tilePos = COORD_TO_TILE(ent);
    ent->field_0x80.HWORD = tilePos;
    SetTile(16509, ent->field_0x80.HWORD, 1);
}

void sub_080A0EF0(Entity* ent) {
    s32 tileIndex;

    tileIndex = GetTileType(ent->field_0x80.HWORD, 1);
    if (tileIndex != 0x407D) {
        sub_08078B48();
        gPlayerEntity.x.WORD = ent->x.WORD;
        gPlayerEntity.y.HALF.HI = ent->y.HALF.HI + 4;
        DeleteThisEntity();
    }
}