summaryrefslogtreecommitdiff
path: root/src/object
diff options
context:
space:
mode:
authorTal Hayon <talhayon1@gmail.com>2022-04-18 00:26:18 +0300
committerTal Hayon <talhayon1@gmail.com>2022-04-18 00:26:32 +0300
commit90eac705f2871b3897a0d718c2a51b7f22b64f10 (patch)
tree581ada8faef804bea9329aa11fd2ccf1f582bba0 /src/object
parentac8b0220b5d88e1a473c149f0f3f354f1d43e334 (diff)
Put const data in swordsmanNewsletter
Diffstat (limited to 'src/object')
-rw-r--r--src/object/swordsmanNewsletter.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/object/swordsmanNewsletter.c b/src/object/swordsmanNewsletter.c
index d71fd1f8..344ea110 100644
--- a/src/object/swordsmanNewsletter.c
+++ b/src/object/swordsmanNewsletter.c
@@ -3,27 +3,33 @@
#include "message.h"
extern void sub_080787B4(Entity*);
+void sub_080933D8(Entity*);
+void sub_080933FC(Entity*);
-extern void (*const gUnk_081228B0[])(Entity*);
-
-extern Hitbox gUnk_081228A8;
-extern u16 gUnk_081228B8[];
+static const Hitbox gUnk_081228A8 = { 0, 0, {}, 6, 8 };
void SwordsmanNewsletter(Entity* this) {
- gUnk_081228B0[this->action](this);
+ static void (*const actionFuncs[])(Entity*) = {
+ sub_080933D8,
+ sub_080933FC,
+ };
+ actionFuncs[this->action](this);
}
void sub_080933D8(Entity* this) {
this->action = 1;
this->frameIndex = this->type;
UpdateSpriteForCollisionLayer(this);
- this->hitbox = &gUnk_081228A8;
+ this->hitbox = (Hitbox*)&gUnk_081228A8;
sub_080787B4(this);
}
void sub_080933FC(Entity* this) {
+ static const u16 messageIndices[] = {
+ 0x301, 0x302, 0x303, 0x304, 0x305, 0x306, 0x307, 0x308,
+ };
if (this->interactType != 0) {
this->interactType = 0;
- MessageNoOverlap(gUnk_081228B8[this->type], this);
+ MessageNoOverlap(messageIndices[this->type], this);
}
}