diff --git a/src/game/chr/chr.c b/src/game/chr/chr.c index c1ab236e9..3d9334427 100644 --- a/src/game/chr/chr.c +++ b/src/game/chr/chr.c @@ -16096,6 +16096,89 @@ glabel func0f028f7c /* f0291d0: 27bd0028 */ addiu $sp,$sp,0x28 ); +// Mismatch: Goal uses a temp register for thing and handles the i/j loop +// differently. +//void func0f028f7c(struct prop *prop, f32 shield, struct prop *arg2, struct modelnode *node, struct model *model, s32 side, s16 *arg6) +//{ +// struct var80062a8c *thing = NULL; +// s32 i; +// s32 j; +// +// for (i = 0; i < 20; i++) { +// if (var80062a8c[i].prop == NULL) { +// thing = &var80062a8c[i]; +// break; +// } +// } +// +// if (thing == NULL) { +// for (i = 0; i < 20; i++) { +// if (var80062a8c[i].lvframe60 < g_Vars.lvframe60) { +// thing = &var80062a8c[i]; +// } +// } +// } +// +// if (thing) { +// thing->prop = prop; +// thing->node = node; +// thing->model = model; +// thing->side = side; +// thing->lvframe60 = g_Vars.lvframe60; +// +// for (i = 0; i < 32; i++) { +// thing->unk018[i] = -1; +// } +// +// thing->unk011 = 2 + (random() % 6); +// thing->shield = shield; +// +// if (arg6) { +// thing->unk012 = arg6[0]; +// thing->unk014 = arg6[1]; +// thing->unk016 = arg6[2]; +// } else { +// thing->unk012 = 0x7fff; +// } +// +// if (node) { +// bool pass = true; +// +// for (i = 0; i < 20; i++) { +// if (var80062a8c[i].prop == prop) { +// for (j = 0; j < 32; j++) { +// if (var80062a8c[i].unk018[j] != -1 && var80062a8c[i].unk018[j] != -2) { +// pass = false; +// break; +// } +// } +// +// if (!pass) { +// break; +// } +// } +// } +// +// if (pass) { +// s32 index = func0f028e18(arg2, node, model, prop); +// +// if (index < 32) { +// thing->unk018[index] = 0; +// thing->unk038[index] = 0; +// } +// } +// } +// +// if (prop->type == PROPTYPE_CHR || prop->type == PROPTYPE_PLAYER) { +// prop->chr->hidden2 |= CHRH2FLAG_0002; +// } else if (prop->type == PROPTYPE_OBJ || prop->type == PROPTYPE_WEAPON || prop->type == PROPTYPE_DOOR) { +// prop->obj->flags3 |= OBJFLAG3_00020000; +// } +// } +// +// var80062a90 = true; +//} + void func0f0291d4(struct var80062a8c *thing) { s32 exists = false; diff --git a/src/game/chr/chraction.c b/src/game/chr/chraction.c index 8bb6cd0c2..26974d56d 100644 --- a/src/game/chr/chraction.c +++ b/src/game/chr/chraction.c @@ -5429,7 +5429,7 @@ void chrSetShield(struct chrdata *chr, f32 amount) } } -bool func0f034080(struct chrdata *chr, struct modelnode *node, struct prop *prop, struct model *model, s32 side, s32 arg5) +bool func0f034080(struct chrdata *chr, struct modelnode *node, struct prop *prop, struct model *model, s32 side, s16 *arg5) { if (chrGetShield(chr) > 0) { if (node && (node->type & 0xff) == MODELNODETYPE_BBOX) { @@ -5455,7 +5455,7 @@ void chrDamageByMisc(struct chrdata *chr, f32 damage, struct coord *vector, stru NULL, // node NULL, // model -1, // side - 0, // arg11 + NULL, // arg11 false, // explosion NULL); // explosionpos } @@ -5468,12 +5468,12 @@ void chrDamageByLaser(struct chrdata *chr, f32 damage, struct coord *vector, str NULL, // node NULL, // model -1, // side - 0, // arg11 + NULL, // arg11 false, // explosion NULL); // explosionpos } -void func0f0341dc(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop, u32 ibh, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, u32 arg10) +void func0f0341dc(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop, u32 ibh, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, s16 *arg10) { chrDamage(chr, damage, vector, hand, prop, ibh, true, // damageshield @@ -5506,7 +5506,7 @@ void func0f034248(struct chrdata *chr, f32 damage, struct coord *vector, struct node, // node model, // model side, // side - 0, // arg11 + NULL, // arg11 false, // explosion NULL); // explosionpos } @@ -5527,7 +5527,7 @@ void func0f034330(struct chrdata *chr, f32 damage, struct coord *vector, struct node, // node model, // model side, // side - 0, // arg11 + NULL, // arg11 false, // explosion NULL); // explosionpos } @@ -5540,7 +5540,7 @@ void chrDamageByExplosion(struct chrdata *chr, f32 damage, struct coord *vector, NULL, // node NULL, // model -1, // side - 0, // arg11 + NULL, // arg11 true, // explosion explosionpos); } @@ -5592,7 +5592,7 @@ void playerUpdateDamageStats(struct prop *attacker, struct prop *victim, f32 dam */ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *aprop, s32 ibh, bool damageshield, struct prop *prop2, - struct modelnode *node, struct model *model, s32 side, s32 arg11, + struct modelnode *node, struct model *model, s32 side, s16 *arg11, bool explosion, struct coord *explosionpos) { bool onehitko = false; diff --git a/src/include/game/chr/chr.h b/src/include/game/chr/chr.h index e7aaa9fec..a76e8dd77 100644 --- a/src/include/game/chr/chr.h +++ b/src/include/game/chr/chr.h @@ -48,7 +48,7 @@ void func0f028590(f32 arg0); u32 func0f028a50(void); s32 func0f028e18(struct prop *arg0, struct modelnode *node, struct model *model, struct prop *arg3); bool func0f028e6c(s32 arg0, struct prop *prop, struct prop **propptr, struct modelnode **nodeptr, struct model **modelptr); -void func0f028f7c(struct prop *prop, f32 shield, struct prop *arg2, struct modelnode *node, struct model *model, s32 side, s32 arg6); +void func0f028f7c(struct prop *prop, f32 shield, struct prop *arg2, struct modelnode *node, struct model *model, s32 side, s16 *arg6); void func0f0291d4(struct var80062a8c *thing); void func0f0292bc(struct prop *prop); s32 func0f02932c(struct prop *prop, s32 arg1); diff --git a/src/include/game/chr/chraction.h b/src/include/game/chr/chraction.h index aab641ff5..cd46a4dd6 100644 --- a/src/include/game/chr/chraction.h +++ b/src/include/game/chr/chraction.h @@ -58,14 +58,14 @@ void chrKnockOut(struct chrdata *chr, f32 angle, s32 ibh, struct shorthand *hand bool chrIsAnimPreventingArgh(struct chrdata *chr, f32 *arg1); void chrChoke(struct chrdata *chr, s32 choketype); void chrSetShield(struct chrdata *chr, f32 shield); -bool func0f034080(struct chrdata *chr, struct modelnode *node, struct prop *prop, struct model *model, s32 side, s32 arg5); +bool func0f034080(struct chrdata *chr, struct modelnode *node, struct prop *prop, struct model *model, s32 side, s16 *arg5); void chrDamageByMisc(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop); void chrDamageByLaser(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop); -void func0f0341dc(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop, u32 ibh, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, u32 arg10); +void func0f0341dc(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop, u32 ibh, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, s16 *arg10); void func0f034330(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop, s32 arg5); void chrDamageByExplosion(struct chrdata *chr, f32 damage, struct coord *vector, struct prop *prop, struct coord *explosionpos); void playerUpdateDamageStats(struct prop *attacker, struct prop *victim, f32 damage); -void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *aprop, s32 ibh, bool damageshield, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, s32 arg11, bool explosion, struct coord *explosionpos); +void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *aprop, s32 ibh, bool damageshield, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, s16 *arg11, bool explosion, struct coord *explosionpos); u32 func0f03645c(void); bool func0f03654c(struct chrdata *chr, struct coord *pos, s16 *rooms, struct coord *pos2, s16 *rooms2, struct coord *vector, f32 arg6, u32 types); bool propchrHasClearLineToPos(struct prop *prop, struct coord *dstpos, struct coord *vector); diff --git a/src/include/types.h b/src/include/types.h index 2c2a66be4..d4d3c549c 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -6053,28 +6053,17 @@ struct rend_vidat { struct var80062a8c { /*0x00*/ struct prop *prop; - /*0x04*/ u32 unk004; - /*0x08*/ u32 unk008; - /*0x0c*/ u32 unk00c; - /*0x10*/ u32 unk010; - /*0x14*/ u32 unk014; - /*0x18*/ u32 unk018; - /*0x1c*/ u32 unk01c; - /*0x20*/ u32 unk020; - /*0x24*/ u32 unk024; - /*0x28*/ u32 unk028; - /*0x2c*/ u32 unk02c; - /*0x30*/ u32 unk030; - /*0x34*/ u32 unk034; - /*0x38*/ u32 unk038; - /*0x3c*/ u32 unk03c; - /*0x40*/ u32 unk040; - /*0x44*/ u32 unk044; - /*0x48*/ u32 unk048; - /*0x4c*/ u32 unk04c; - /*0x50*/ u32 unk050; - /*0x54*/ u32 unk054; - /*0x58*/ u32 unk058; + /*0x04*/ struct modelnode *node; + /*0x08*/ struct model *model; + /*0x0c*/ s32 lvframe60; + /*0x10*/ s8 side; + /*0x11*/ s8 unk011; + /*0x12*/ s16 unk012; + /*0x14*/ s16 unk014; + /*0x14*/ s16 unk016; + /*0x18*/ s8 unk018[32]; + /*0x38*/ s8 unk038[32]; + /*0x58*/ f32 shield; }; struct bgroom {