summaryrefslogtreecommitdiff
path: root/src/manager/flameManager.c
blob: 880324fd753390b2530dfc73d748bdd765d24604 (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
/**
 * @file flameManager.c
 * @ingroup Managers
 *
 * @brief Manages flame that can be ignited with the lamp.
 *
 * However, this manager is deleted when the flame is ignited the first time.
 */
#include "manager/flameManager.h"
#include "asm.h"
#include "functions.h"
#include "room.h"

void FlameManager_Main(FlameManager* this) {
    if (super->action == 0) {
        this->field_0x38 = TILE(this->field_0x38, this->field_0x3a);
        if (GetTileType(this->field_0x38, 2) == 0x75) {
            super->action = 1;
            SetTile(0x406a, this->field_0x38, 1);
        } else {
            DeleteThisEntity();
        }
    }
    if (GetTileType(this->field_0x38, 1) == 0x406b) {
        sub_0807B7D8(0x76, this->field_0x38, 2);
        DeleteThisEntity();
    }
    if (GetTileType(this->field_0x38, 2) == 0x76) {
        SetTile(0x406b, this->field_0x38, 1);
        DeleteThisEntity();
    }
}