Fix parameters for all functions called from scripts

This commit is contained in:
octorock
2021-03-06 23:13:26 +01:00
parent 74e48d98b0
commit 8f7ad0a35c
39 changed files with 253 additions and 332 deletions
+8 -7
View File
@@ -6,6 +6,7 @@
#include "greatFairy.h"
#include "functions.h"
#include "save.h"
#include "script.h"
enum {
BEHAVIORS,
@@ -517,7 +518,7 @@ void sub_080873D0(Entity* this) {
}
}
void sub_080873FC(void) {
void sub_080873FC() {
Entity* ent;
SoundReq(0xf7);
@@ -528,7 +529,7 @@ void sub_080873FC(void) {
}
}
void sub_08087424(Entity* arg0, struct_08087424* arg1) {
void sub_08087424(Entity* this, ScriptExecutionContext* context) {
Entity* ent;
sub_080791D0();
@@ -539,9 +540,9 @@ void sub_08087424(Entity* arg0, struct_08087424* arg1) {
sub_0805E3A0(ent, 2);
}
switch (arg1->unk4) {
switch (context->unk_04) {
case 0:
gSave.stats.arrowCount = arg1->unk4;
gSave.stats.arrowCount = 0;
break;
case 1:
gSave.stats.bombCount = 0;
@@ -549,14 +550,14 @@ void sub_08087424(Entity* arg0, struct_08087424* arg1) {
}
}
void sub_0808747C(u32 arg0, u32 arg1) {
u32 iVar1;
void sub_0808747C(Entity* this, ScriptExecutionContext* context) {
u32 iVar1 = 0;
iVar1 = (u32)FindEntityInListByForm(0x6, 0xf, 0x6, 0xb, 0x0);
if (iVar1 != 0) {
iVar1 = 1;
}
*(u32*)(arg1 + 0x14) = iVar1;
context->condition = iVar1;
}
// clang-format off
+5 -6
View File
@@ -174,11 +174,10 @@ static u8 sub_08086954(Entity* this) {
return this->actionDelay;
}
// TODO: Second arg is some unknown struct.
void sub_080869A4(Entity* entityA, u32* entityB) {
entityB[5] = 0;
if (!sub_08086954(entityA)) {
entityA->actionDelay = 8;
entityB[5] = 1;
void sub_080869A4(Entity* this, ScriptExecutionContext* context) {
context->condition = 0;
if (!sub_08086954(this)) {
this->actionDelay = 8;
context->condition = 1;
}
}