Added manager.h

Moved the unknown struct from manager6.c to new header manager.h
This commit is contained in:
Ibot02 2020-08-08 02:57:52 +02:00
parent d21e39060f
commit 6bf6cc2d6a
2 changed files with 26 additions and 19 deletions

23
include/manager.h Normal file
View File

@ -0,0 +1,23 @@
#ifndef MANAGER_H
#define MANAGER_H
#include "global.h"
typedef struct {
u16 field_0x00;
u16 field_0x02;
u8 field_0x04;
u8 field_0x05;
u8 field_0x06;
union {
u8 all;
struct {
u8 layer : 2;
u8 unk1 : 2;
u8 unk2 : 1;
u8 unk3 : 3;
} PACKED b;
} PACKED field_0x07;
} UnkManagerHelperStruct;
#endif

View File

@ -1,32 +1,16 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "manager.h"
extern void* GetCurrentRoomProperty(u8);
extern u32 CheckPlayerInRegion(u16, u16, u8, u8);
extern void DoExitTransition(void*);
extern void sub_0805E900(Entity*);
typedef struct {
u16 field_0x00;
u16 field_0x02;
u8 field_0x04;
u8 field_0x05;
u8 field_0x06;
union {
u8 all;
struct {
u8 layer : 2;
u8 unk1 : 2;
u8 unk2 : 1;
u8 unk3 : 3;
} PACKED b;
} PACKED field_0x07;
} unknownStruct;
void sub_08057CB4(Entity * this) {
u32 tmp;
unknownStruct* i;
UnkManagerHelperStruct* i;
if (this->action == 0){
this->action = 1;
this->field_0x20 = (s32) GetCurrentRoomProperty(this->entityType.form);
@ -36,7 +20,7 @@ void sub_08057CB4(Entity * this) {
}
}
if (this->actionDelay == 0 || gLinkState.field_0x10[2] == 0x1e) {
for (i = ((unknownStruct*) this->field_0x20);i->field_0x00 != 0xFFFF; i++) {
for (i = ((UnkManagerHelperStruct*) this->field_0x20);i->field_0x00 != 0xFFFF; i++) {
tmp = (i->field_0x07.all & 0x3);
if (((tmp & (gLinkEntity.collisionLayer)) != 0) &&
(((gLinkState.flags.all & 0x80) != 0) || ((i->field_0x07.b.unk2) != 0)) &&