Put const data in mineralWaterSource

This commit is contained in:
Tal Hayon
2022-04-18 00:33:29 +03:00
parent 90eac705f2
commit 551c36849c
4 changed files with 19 additions and 30 deletions
+18 -12
View File
@@ -1,22 +1,28 @@
#include "object.h"
extern void (*MineralWaterSourceActionFuncs[])(Entity*);
void MineralWaterSource_Init(Entity*);
void sub_080973DC(Entity*);
typedef struct {
u8 field_0x00;
u8 field_0x01;
u8 field_0x02;
u8 field_0x03;
u8 type2;
u8 hitboxWidth;
u8 hitboxHeight;
u8 hurtType;
} UnkStruct_MineralWater;
extern UnkStruct_MineralWater MineralWaterSourceParameters[];
void MineralWaterSource(Entity* this) {
static void (*const MineralWaterSourceActionFuncs[])(Entity*) = {
MineralWaterSource_Init,
sub_080973DC,
};
MineralWaterSourceActionFuncs[this->action](this);
}
void MineralWaterSource_Init(Entity* this) {
UnkStruct_MineralWater* unknownParameters;
static const UnkStruct_MineralWater MineralWaterSourceParameters[] = {
{ 0x27, 0x30, 0x20, 0x4D },
};
const UnkStruct_MineralWater* unknownParameters;
if (AllocMutableHitbox(this) == NULL) {
return;
@@ -24,11 +30,11 @@ void MineralWaterSource_Init(Entity* this) {
unknownParameters = &MineralWaterSourceParameters[this->type];
this->type2 = unknownParameters->field_0x00;
this->hurtType = unknownParameters->field_0x03;
this->type2 = unknownParameters->type2;
this->hurtType = unknownParameters->hurtType;
this->hitbox->width = unknownParameters->field_0x01;
this->hitbox->height = unknownParameters->field_0x02;
this->hitbox->width = unknownParameters->hitboxWidth;
this->hitbox->height = unknownParameters->hitboxHeight;
COLLISION_ON(this);