From a39eca8c57b0d16eccd916db24fccec956991591 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Wed, 26 May 2021 18:45:49 +1000 Subject: [PATCH] Rename shorthand to gset --- src/game/activemenu/activemenu.c | 6 +- src/game/activemenu/tick.c | 4 +- src/game/chr/chr.c | 22 +-- src/game/chr/chraction.c | 204 ++++++++++++------------ src/game/chr/chraicommands.c | 12 +- src/game/game_097ba0.c | 260 +++++++++++++++---------------- src/game/game_0abe70.c | 4 +- src/game/game_0b0fd0.c | 108 ++++++------- src/game/game_190260.c | 2 +- src/game/game_1999b0.c | 18 +-- src/game/lv.c | 10 +- src/game/mpstats.c | 10 +- src/game/prop.c | 30 ++-- src/game/propobj.c | 72 ++++----- src/game/sight.c | 8 +- src/include/game/chr/chraction.h | 20 +-- src/include/game/game_097ba0.h | 8 +- src/include/game/game_0b0fd0.h | 30 ++-- src/include/game/mpstats.h | 4 +- src/include/game/prop.h | 2 +- src/include/game/propobj.h | 4 +- src/include/types.h | 8 +- 22 files changed, 423 insertions(+), 423 deletions(-) diff --git a/src/game/activemenu/activemenu.c b/src/game/activemenu/activemenu.c index 08594f690..e6c1062a3 100644 --- a/src/game/activemenu/activemenu.c +++ b/src/game/activemenu/activemenu.c @@ -648,7 +648,7 @@ void amApply(s32 slot) if (g_FrIsValidWeapon) { s32 weaponnum = frGetWeaponBySlot(frGetSlot()); - if (g_Vars.currentplayer->hands[HAND_RIGHT].base.weaponnum == weaponnum) { + if (g_Vars.currentplayer->hands[HAND_RIGHT].gset.weaponnum == weaponnum) { pass = false; } } @@ -771,8 +771,8 @@ void amGetSlotDetails(s32 slot, u32 *flags, char *label) if (slot == 4) { strcpy(label, langGet(L_MISC_171)); // "Function" } else if (slot == 1 || slot == 7) { - prifunc = weaponGetFunction(&g_Vars.currentplayer->hands[HAND_RIGHT].base, FUNC_PRIMARY); - secfunc = weaponGetFunction(&g_Vars.currentplayer->hands[HAND_RIGHT].base, FUNC_SECONDARY); + prifunc = weaponGetFunction(&g_Vars.currentplayer->hands[HAND_RIGHT].gset, FUNC_PRIMARY); + secfunc = weaponGetFunction(&g_Vars.currentplayer->hands[HAND_RIGHT].gset, FUNC_SECONDARY); if (slot == 1) { if (!secfunc diff --git a/src/game/activemenu/tick.c b/src/game/activemenu/tick.c index 86a1531be..80980e0c5 100644 --- a/src/game/activemenu/tick.c +++ b/src/game/activemenu/tick.c @@ -285,8 +285,8 @@ void amTick(void) // If weapon has no functions, skip past function screen if (g_AmMenus[g_AmIndex].screenindex == 1) { - struct weaponfunc *pri = weaponGetFunction(&g_Vars.currentplayer->hands[0].base, FUNC_PRIMARY); - struct weaponfunc *sec = weaponGetFunction(&g_Vars.currentplayer->hands[0].base, FUNC_SECONDARY); + struct weaponfunc *pri = weaponGetFunction(&g_Vars.currentplayer->hands[0].gset, FUNC_PRIMARY); + struct weaponfunc *sec = weaponGetFunction(&g_Vars.currentplayer->hands[0].gset, FUNC_SECONDARY); if (!pri && !sec) { amChangeScreen(gotonextscreen); diff --git a/src/game/chr/chr.c b/src/game/chr/chr.c index da409c8a2..5b4451415 100644 --- a/src/game/chr/chr.c +++ b/src/game/chr/chr.c @@ -6862,7 +6862,7 @@ void chrTickPoisoned(struct chrdata *chr) if (chr->poisoncounter > 0) { struct coord coord = {0, 0, 0}; - struct shorthand hand = { WEAPON_COMBATKNIFE, 0, 0, FUNC_POISON }; + struct gset gset = { WEAPON_COMBATKNIFE, 0, 0, FUNC_POISON }; if (chr->actiontype == ACT_DEAD || chr->actiontype == ACT_DIE) { // Dying chr @@ -6895,7 +6895,7 @@ void chrTickPoisoned(struct chrdata *chr) if (chr->poisoncounter <= 0) { if (!g_Vars.normmplayerisrunning) { - chrDamageByMisc(chr, 100, &coord, &hand, chr->poisonprop); + chrDamageByMisc(chr, 100, &coord, &gset, chr->poisonprop); chrFlinchHead(chr, M_PI); } @@ -6906,7 +6906,7 @@ void chrTickPoisoned(struct chrdata *chr) if (g_Vars.normmplayerisrunning) { if (chr->poisoncounter / PALDOWN(720) != (chr->poisoncounter + g_Vars.lvupdate240) / PALDOWN(720)) { - chrDamageByMisc(chr, 1.3f, &coord, &hand, chr->poisonprop); + chrDamageByMisc(chr, 1.3f, &coord, &gset, chr->poisonprop); } } } @@ -14482,7 +14482,7 @@ glabel func0f027e1c /* f027e30: 00a08825 */ or $s1,$a1,$zero /* f027e34: afb00034 */ sw $s0,0x34($sp) /* f027e38: a3a0008f */ sb $zero,0x8f($sp) -/* f027e3c: 0fc2c41f */ jal handGetWeaponFunction +/* f027e3c: 0fc2c41f */ jal gsetGetWeaponFunction /* f027e40: afa40048 */ sw $a0,0x48($sp) /* f027e44: 50400009 */ beqzl $v0,.L0f027e6c /* f027e48: 8e300004 */ lw $s0,0x4($s1) @@ -14540,7 +14540,7 @@ glabel func0f027e1c /* f027f0c: 27a400a4 */ addiu $a0,$sp,0xa4 /* f027f10: 8fa40048 */ lw $a0,0x48($sp) /* f027f14: 8e250004 */ lw $a1,0x4($s1) -/* f027f18: 0fc29f66 */ jal handPlayPropHitSound +/* f027f18: 0fc29f66 */ jal gsetPlayPropHitSound /* f027f1c: 2406ffff */ addiu $a2,$zero,-1 /* f027f20: 8fa200f8 */ lw $v0,0xf8($sp) /* f027f24: 3c0b800a */ lui $t3,%hi(g_Vars+0x284) @@ -14573,7 +14573,7 @@ glabel func0f027e1c /* f027f90: 0fc0cfe8 */ jal chrGetShield /* f027f94: a7ab0094 */ sh $t3,0x94($sp) /* f027f98: e7a00084 */ swc1 $f0,0x84($sp) -/* f027f9c: 0fc2c74a */ jal handGetDamage +/* f027f9c: 0fc2c74a */ jal gsetGetDamage /* f027fa0: 8fa40048 */ lw $a0,0x48($sp) /* f027fa4: 3c0c800a */ lui $t4,%hi(g_Vars+0x284) /* f027fa8: 8d8ca244 */ lw $t4,%lo(g_Vars+0x284)($t4) @@ -14676,7 +14676,7 @@ glabel func0f027e1c /* f028118: 8d4b0014 */ lw $t3,0x14($t2) /* f02811c: 356c0001 */ ori $t4,$t3,0x1 /* f028120: ad4c0014 */ sw $t4,0x14($t2) -/* f028124: 0fc2c74a */ jal handGetDamage +/* f028124: 0fc2c74a */ jal gsetGetDamage /* f028128: 8fa40048 */ lw $a0,0x48($sp) /* f02812c: 8fad00f8 */ lw $t5,0xf8($sp) /* f028130: 3c0e800a */ lui $t6,%hi(g_Vars+0x28c) @@ -14925,7 +14925,7 @@ glabel func0f027e1c /* f02784c: 00a08825 */ or $s1,$a1,$zero /* f027850: afb00034 */ sw $s0,0x34($sp) /* f027854: a3a0008f */ sb $zero,0x8f($sp) -/* f027858: 0fc2bb77 */ jal handGetWeaponFunction +/* f027858: 0fc2bb77 */ jal gsetGetWeaponFunction /* f02785c: afa40048 */ sw $a0,0x48($sp) /* f027860: 50400009 */ beqzl $v0,.NB0f027888 /* f027864: 8e300004 */ lw $s0,0x4($s1) @@ -14983,7 +14983,7 @@ glabel func0f027e1c /* f027928: 27a400a4 */ addiu $a0,$sp,0xa4 /* f02792c: 8fa40048 */ lw $a0,0x48($sp) /* f027930: 8e250004 */ lw $a1,0x4($s1) -/* f027934: 0fc296b1 */ jal handPlayPropHitSound +/* f027934: 0fc296b1 */ jal gsetPlayPropHitSound /* f027938: 2406ffff */ addiu $a2,$zero,-1 /* f02793c: 8fa200f8 */ lw $v0,0xf8($sp) /* f027940: 3c0a800a */ lui $t2,0x800a @@ -15016,7 +15016,7 @@ glabel func0f027e1c /* f0279ac: 0fc0ce2a */ jal chrGetShield /* f0279b0: a7a90094 */ sh $t1,0x94($sp) /* f0279b4: e7a00084 */ swc1 $f0,0x84($sp) -/* f0279b8: 0fc2bea2 */ jal handGetDamage +/* f0279b8: 0fc2bea2 */ jal gsetGetDamage /* f0279bc: 8fa40048 */ lw $a0,0x48($sp) /* f0279c0: 3c0a800a */ lui $t2,0x800a /* f0279c4: 8d4ae944 */ lw $t2,-0x16bc($t2) @@ -15119,7 +15119,7 @@ glabel func0f027e1c /* f027b34: 8dcf0014 */ lw $t7,0x14($t6) /* f027b38: 35f80001 */ ori $t8,$t7,0x1 /* f027b3c: add80014 */ sw $t8,0x14($t6) -/* f027b40: 0fc2bea2 */ jal handGetDamage +/* f027b40: 0fc2bea2 */ jal gsetGetDamage /* f027b44: 8fa40048 */ lw $a0,0x48($sp) /* f027b48: 8fb900f8 */ lw $t9,0xf8($sp) /* f027b4c: 3c09800a */ lui $t1,0x800a diff --git a/src/game/chr/chraction.c b/src/game/chr/chraction.c index a929e286c..d602c67f3 100644 --- a/src/game/chr/chraction.c +++ b/src/game/chr/chraction.c @@ -3019,7 +3019,7 @@ u8 var80068080 = 50; * - Updating kill statistics * - Dropping items */ -void chrBeginDeath(struct chrdata *chr, struct coord *dir, f32 relangle, s32 hitpart, struct shorthand *hand, bool knockout, s32 aplayernum) +void chrBeginDeath(struct chrdata *chr, struct coord *dir, f32 relangle, s32 hitpart, struct gset *gset, bool knockout, s32 aplayernum) { bool overridden = false; bool instant; @@ -3167,7 +3167,7 @@ void chrBeginDeath(struct chrdata *chr, struct coord *dir, f32 relangle, s32 hit // Handle robots and Dr Caroll then return early if (race == RACE_ROBOT || race == RACE_DRCAROLL) { - mult1 = handGetStrength(hand) * 0.5f; + mult1 = gsetGetStrength(gset) * 0.5f; if (mult1 <= 0) { mult1 = 3; @@ -3339,7 +3339,7 @@ void chrBeginDeath(struct chrdata *chr, struct coord *dir, f32 relangle, s32 hit modelSetAnimEndFrame(model, row->endframe); } - mult2 = handGetStrength(hand); + mult2 = gsetGetStrength(gset); if (mult2 <= 0 && (chr->chrflags & CHRCFLAG_00008000)) { mult2 = 6; @@ -3392,7 +3392,7 @@ void chrBeginDeath(struct chrdata *chr, struct coord *dir, f32 relangle, s32 hit modelSetAnimEndFrame(model, row->endframe); } - mult3 = handGetStrength(hand); + mult3 = gsetGetStrength(gset); if (mult3 <= 0 && (chr->chrflags & CHRCFLAG_00008000)) { mult3 = 6; @@ -3568,7 +3568,7 @@ void chrBeginArgh(struct chrdata *chr, f32 angle, s32 hitpart) } } -void chrReactToDamage(struct chrdata *chr, struct coord *vector, f32 angle, s32 hitpart, struct shorthand *hand, s32 aplayernum) +void chrReactToDamage(struct chrdata *chr, struct coord *vector, f32 angle, s32 hitpart, struct gset *gset, s32 aplayernum) { s32 race = CHRRACE(chr); bool knockedout = false; @@ -3586,7 +3586,7 @@ void chrReactToDamage(struct chrdata *chr, struct coord *vector, f32 angle, s32 } if (race == RACE_EYESPY) { - f32 strength = handGetStrength(hand); + f32 strength = gsetGetStrength(gset); struct eyespy *eyespy = chrToEyespy(chr); if (eyespy) { @@ -3603,7 +3603,7 @@ void chrReactToDamage(struct chrdata *chr, struct coord *vector, f32 angle, s32 } if (chr->damage >= chr->maxdamage) { - chrBeginDeath(chr, vector, angle, hitpart, hand, false, aplayernum); + chrBeginDeath(chr, vector, angle, hitpart, gset, false, aplayernum); } else if (animnum == ANIM_SNIPING_GETDOWN || animnum == ANIM_SNIPING_GETUP || animnum == ANIM_SNIPING_ONGROUND) { @@ -3611,7 +3611,7 @@ void chrReactToDamage(struct chrdata *chr, struct coord *vector, f32 angle, s32 } else if (race == RACE_EYESPY) { // empty } else if (race == RACE_DRCAROLL || race == RACE_ROBOT) { - f32 strength = handGetStrength(hand); + f32 strength = gsetGetStrength(gset); if (race == RACE_DRCAROLL) { strength *= 0.5f; @@ -3727,7 +3727,7 @@ void chrYeetFromPos(struct chrdata *chr, struct coord *exppos, f32 force) } } -s32 handGetBlurAmount(struct shorthand *hand) +s32 gsetGetBlurAmount(struct gset *gset) { s32 amount = PALDOWN(1000); @@ -3735,22 +3735,22 @@ s32 handGetBlurAmount(struct shorthand *hand) amount = PALDOWN(250); } - if (hand->weaponnum == WEAPON_TRANQUILIZER) { + if (gset->weaponnum == WEAPON_TRANQUILIZER) { amount = PALDOWN(2000); } - if (hand->weaponnum == WEAPON_BOLT) { + if (gset->weaponnum == WEAPON_BOLT) { amount = PALDOWN(5000); } - if (hand->weaponnum == WEAPON_NBOMB) { + if (gset->weaponnum == WEAPON_NBOMB) { amount = PALDOWN(100); } return amount; } -void chrKnockOut(struct chrdata *chr, f32 angle, s32 hitpart, struct shorthand *hand) +void chrKnockOut(struct chrdata *chr, f32 angle, s32 hitpart, struct gset *gset) { if (chr->actiontype != ACT_DRUGGEDCOMINGUP && chr->actiontype != ACT_DRUGGEDDROP @@ -4135,9 +4135,9 @@ bool func0f034080(struct chrdata *chr, struct modelnode *node, struct prop *prop * * Used for knife poison, nbomb damage, Investigation radioactivity and Escape gas. */ -void chrDamageByMisc(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop) +void chrDamageByMisc(struct chrdata *chr, f32 damage, struct coord *vector, struct gset *gset, struct prop *prop) { - chrDamage(chr, damage, vector, hand, prop, HITPART_GENERAL, + chrDamage(chr, damage, vector, gset, prop, HITPART_GENERAL, false, // damageshield NULL, // prop2 NULL, // node @@ -4148,9 +4148,9 @@ void chrDamageByMisc(struct chrdata *chr, f32 damage, struct coord *vector, stru NULL); // explosionpos } -void chrDamageByLaser(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 gset *gset, struct prop *prop) { - chrDamage(chr, damage, vector, hand, prop, HITPART_GENERAL, + chrDamage(chr, damage, vector, gset, prop, HITPART_GENERAL, true, // damageshield chr->prop, // prop2 NULL, // node @@ -4161,9 +4161,9 @@ void chrDamageByLaser(struct chrdata *chr, f32 damage, struct coord *vector, str NULL); // explosionpos } -void func0f0341dc(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop, u32 hitpart, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, s16 *arg10) +void func0f0341dc(struct chrdata *chr, f32 damage, struct coord *vector, struct gset *gset, struct prop *prop, u32 hitpart, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, s16 *arg10) { - chrDamage(chr, damage, vector, hand, prop, hitpart, + chrDamage(chr, damage, vector, gset, prop, hitpart, true, // damageshield prop2, // prop2 node, // node @@ -4177,7 +4177,7 @@ void func0f0341dc(struct chrdata *chr, f32 damage, struct coord *vector, struct /** * Unused, and same as chrDamageByImpact but sets hitpart to HITPART_GENERAL instead of argument. */ -void func0f034248(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop) +void func0f034248(struct chrdata *chr, f32 damage, struct coord *vector, struct gset *gset, struct prop *prop) { struct modelnode *node = NULL; struct model *model = NULL; @@ -4188,7 +4188,7 @@ void func0f034248(struct chrdata *chr, f32 damage, struct coord *vector, struct chrCalculateShieldHit(chr, &chr->prop->pos, vector, &node, &hitpart, &model, &side); } - chrDamage(chr, damage, vector, hand, prop, HITPART_GENERAL, + chrDamage(chr, damage, vector, gset, prop, HITPART_GENERAL, true, // damageshield chr->prop, // prop2 node, // node @@ -4202,7 +4202,7 @@ void func0f034248(struct chrdata *chr, f32 damage, struct coord *vector, struct /** * Used for punching, but also used by AI commands to make chrs take damage. */ -void chrDamageByImpact(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop, s32 hitpart) +void chrDamageByImpact(struct chrdata *chr, f32 damage, struct coord *vector, struct gset *gset, struct prop *prop, s32 hitpart) { struct modelnode *node = NULL; struct model *model = NULL; @@ -4212,7 +4212,7 @@ void chrDamageByImpact(struct chrdata *chr, f32 damage, struct coord *vector, st chrCalculateShieldHit(chr, &chr->prop->pos, vector, &node, &hitpart, &model, &side); } - chrDamage(chr, damage, vector, hand, prop, hitpart, + chrDamage(chr, damage, vector, gset, prop, hitpart, true, // damageshield chr->prop, // prop2 node, // node @@ -4269,7 +4269,7 @@ void playerUpdateDamageStats(struct prop *attacker, struct prop *victim, f32 dam * chr - the chr being damaged * damage - the base amount of damage to deal, prior to scaling factors * vector - position of the attacker? - * hand - shorthand struct defining the weapon and gun function being used + * gset - gun settings struct * aprop - the attacker's prop struct * hitpart - "i've been hit" value, ie. the body part (see HITPART constants) * damageshield - false if attack should bypass shield if any @@ -4281,7 +4281,7 @@ void playerUpdateDamageStats(struct prop *attacker, struct prop *victim, f32 dam * explosion - true if damage is coming from an explosion * explosionpos - position of said explosion */ -void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, +void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gset *gset, struct prop *aprop, s32 hitpart, bool damageshield, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, s16 *arg11, bool explosion, struct coord *explosionpos) @@ -4296,7 +4296,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho bool usedshield = false; bool showshield = false; bool showdamage = false; - struct shorthand hand2 = {0}; + struct gset gset2 = {0}; f32 explosionforce = damage; f32 healthscale = 1; f32 armourscale = 1; @@ -4312,17 +4312,17 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho choketype = CHOKETYPE_GURGLE; } - if (hand) { - if (hand->weaponnum == WEAPON_COMBATKNIFE) { - if (hand->weaponfunc == FUNC_2) { + if (gset) { + if (gset->weaponnum == WEAPON_COMBATKNIFE) { + if (gset->weaponfunc == FUNC_2) { canchoke = false; } - if (hand->weaponfunc == FUNC_POISON) { + if (gset->weaponfunc == FUNC_POISON) { choketype = CHOKETYPE_COUGH; } - } else if (hand->weaponnum == WEAPON_TRANQUILIZER) { - if (hand->weaponfunc == FUNC_SECONDARY) { + } else if (gset->weaponnum == WEAPON_TRANQUILIZER) { + if (gset->weaponfunc == FUNC_SECONDARY) { choketype = CHOKETYPE_GURGLE; } } @@ -4375,13 +4375,13 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho return; } - if (hand == NULL) { - hand = &hand2; + if (gset == NULL) { + gset = &gset2; } - func = handGetWeaponFunction(hand); + func = gsetGetWeaponFunction(gset); isclose = func && (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE; - makedizzy = race != RACE_DRCAROLL && handHasFunctionFlags(hand, FUNCFLAG_MAKEDIZZY); + makedizzy = race != RACE_DRCAROLL && gsetHasFunctionFlags(gset, FUNCFLAG_MAKEDIZZY); if (chr->prop == g_Vars.currentplayer->prop && g_Vars.currentplayer->invincible) { return; @@ -4403,8 +4403,8 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho } // Disarm only hurts the victim in solo missions and if the victim is an NPC - if (handHasFunctionFlags(hand, FUNCFLAG_DROPWEAPON) - && hand->weaponnum == WEAPON_UNARMED + if (gsetHasFunctionFlags(gset, FUNCFLAG_DROPWEAPON) + && gset->weaponnum == WEAPON_UNARMED && (vprop->type == PROPTYPE_PLAYER || g_Vars.normmplayerisrunning)) { damage = 0; } @@ -4535,7 +4535,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho } // If using the shotgun, scale the damage based on distance - if (aprop && aprop->type == PROPTYPE_CHR && hand->weaponnum == WEAPON_SHOTGUN) { + if (aprop && aprop->type == PROPTYPE_CHR && gset->weaponnum == WEAPON_SHOTGUN) { f32 xdiff = aprop->pos.x - vprop->pos.x; f32 ydiff = aprop->pos.y - vprop->pos.y; f32 zdiff = aprop->pos.z - vprop->pos.z; @@ -4554,7 +4554,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho // damageshield is an argument to this function, // but is forced on if using the Farsight. - if (hand && hand->weaponnum == WEAPON_FARSIGHT) { + if (gset && gset->weaponnum == WEAPON_FARSIGHT) { damageshield = true; damage *= 10; } @@ -4645,20 +4645,20 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho if (!alreadydead && hitpart) { switch (hitpart) { case HITPART_HEAD: - mpstatsIncrementPlayerShotCount2(hand, SHOTREGION_HEAD); + mpstatsIncrementPlayerShotCount2(gset, SHOTREGION_HEAD); break; case HITPART_GUN: - mpstatsIncrementPlayerShotCount2(hand, SHOTREGION_GUN); + mpstatsIncrementPlayerShotCount2(gset, SHOTREGION_GUN); break; case HITPART_HAT: - mpstatsIncrementPlayerShotCount2(hand, SHOTREGION_HAT); + mpstatsIncrementPlayerShotCount2(gset, SHOTREGION_HAT); break; case HITPART_PELVIS: case HITPART_TORSO: - mpstatsIncrementPlayerShotCount2(hand, SHOTREGION_BODY); + mpstatsIncrementPlayerShotCount2(gset, SHOTREGION_BODY); break; default: - mpstatsIncrementPlayerShotCount2(hand, SHOTREGION_LIMB); + mpstatsIncrementPlayerShotCount2(gset, SHOTREGION_LIMB); break; } } @@ -4698,8 +4698,8 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho angle = chrGetAngleToPos(chr, &sp9c); // Knife in the back to an unalerted chr is lethal - if (hand->weaponnum == WEAPON_COMBATKNIFE - && hand->weaponfunc == FUNC_PRIMARY + if (gset->weaponnum == WEAPON_COMBATKNIFE + && gset->weaponfunc == FUNC_PRIMARY && angle > 2.0940616130829f && angle < 4.1881237030029f && (chr->alertness < 100 || chr->lastseetarget60 == 0)) { @@ -4707,7 +4707,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho } // Punching and pistol whipping is less effective from the front - if (handHasFunctionFlags(hand, FUNCFLAG_BLUNTIMPACT)) { + if (gsetHasFunctionFlags(gset, FUNCFLAG_BLUNTIMPACT)) { if (angle < 1.0470308065414f || angle > 5.2351541519165f) { damage *= 0.4f; } else if (angle < 2.0940616130829f || angle > 4.1881237030029f) { @@ -4754,7 +4754,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho chrFlinchHead(chr, angle); damage *= headshotdamagescale; - if (hand->weaponnum == WEAPON_COMBATKNIFE && hand->weaponfunc != FUNC_POISON) { + if (gset->weaponnum == WEAPON_COMBATKNIFE && gset->weaponfunc != FUNC_POISON) { damage += damage; } } @@ -4785,7 +4785,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho f32 boostscale; // Handle player losing gun - if (handHasFunctionFlags(hand, FUNCFLAG_DROPWEAPON)) { + if (gsetHasFunctionFlags(gset, FUNCFLAG_DROPWEAPON)) { currentPlayerLoseGun(aprop); } @@ -4804,9 +4804,9 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho if (!achr || !achr->aibot - || !handHasFunctionFlags(hand, FUNCFLAG_00400000) + || !gsetHasFunctionFlags(gset, FUNCFLAG_00400000) || chr->blurdrugamount < PALDOWN(4500)) { - chr->blurdrugamount += handGetBlurAmount(hand) * blurscale; + chr->blurdrugamount += gsetGetBlurAmount(gset) * blurscale; } chr->blurnumtimesdied = 0; @@ -4851,7 +4851,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho } // Handle player boost - if (isclose && hand->weaponnum == WEAPON_REAPER) { + if (isclose && gset->weaponnum == WEAPON_REAPER) { boostscale = 0.1f; } else if (g_Vars.normmplayerisrunning) { boostscale = 0.75f; @@ -4888,7 +4888,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho // NPC was alive prior to being shot. // Handle aibot/chr losing gun - if (handHasFunctionFlags(hand, FUNCFLAG_DROPWEAPON) + if (gsetHasFunctionFlags(gset, FUNCFLAG_DROPWEAPON) && ((chr->flags & CHRFLAG0_CANLOSEGUN) || chr->aibot)) { if (chr->aibot) { aibotLoseGun(chr, aprop); @@ -4920,10 +4920,10 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho // Handle chr dizziness and psychosis if (makedizzy && race != RACE_DRCAROLL && race != RACE_ROBOT) { - if (handHasFunctionFlags(hand, FUNCFLAG_PSYCHOSIS)) { + if (gsetHasFunctionFlags(gset, FUNCFLAG_PSYCHOSIS)) { chr->hidden |= CHRHFLAG_PSYCHOSISED; } else { - chr->blurdrugamount += handGetBlurAmount(hand); + chr->blurdrugamount += gsetGetBlurAmount(gset); chr->blurnumtimesdied = 0; if (!chr->aibot && chr->blurdrugamount >= PALDOWN(5000)) { @@ -4936,7 +4936,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho if (chr->aibot) { f32 boostscale; - if (isclose && hand->weaponnum == WEAPON_REAPER) { + if (isclose && gset->weaponnum == WEAPON_REAPER) { boostscale = 0.1f; } else { boostscale = 0.75f; @@ -4946,24 +4946,24 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho chr->aibot->shotspeed.z += vector->z * boostscale; } - if (hand->weaponnum == WEAPON_UNARMED) { + if (gset->weaponnum == WEAPON_UNARMED) { sp80 = 2; } - if (hand->weaponnum == WEAPON_TRANQUILIZER || hand->weaponnum == WEAPON_PSYCHOSISGUN) { + if (gset->weaponnum == WEAPON_TRANQUILIZER || gset->weaponnum == WEAPON_PSYCHOSISGUN) { forceapplydamage = true; } // Handle one-hit knockouts if (onehitko && chr->aibot == NULL && race == RACE_HUMAN) { - chrKnockOut(chr, angle, hitpart, hand); + chrKnockOut(chr, angle, hitpart, gset); func0f0926bc(chr->prop, 9, 0); if (canchoke) { chrChoke(chr, choketype); } - if (hand->weaponnum == WEAPON_UNARMED && chr->actiontype != ACT_DRUGGEDKO) { + if (gset->weaponnum == WEAPON_UNARMED && chr->actiontype != ACT_DRUGGEDKO) { return; } @@ -5013,7 +5013,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho chr->damage = chr->maxdamage; if (race == RACE_DRCAROLL || race == RACE_EYESPY || race == RACE_ROBOT) { - chrBeginDeath(chr, vector, angle, hitpart, hand, false, aplayernum); + chrBeginDeath(chr, vector, angle, hitpart, gset, false, aplayernum); } else { chrYeetFromPos(chr, explosionpos, explosionforce); } @@ -5063,12 +5063,12 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho if (makedizzy && chr->damage >= chr->maxdamage) { chr->damage = chr->maxdamage - 0.1f; - chrKnockOut(chr, angle, hitpart, hand); + chrKnockOut(chr, angle, hitpart, gset); } // If chr has armour or the weapon doesn't stun if (chr->damage < 0 || - (handHasFunctionFlags(hand, FUNCFLAG_NOSTUN) && chr->damage < chr->maxdamage)) { + (gsetHasFunctionFlags(gset, FUNCFLAG_NOSTUN) && chr->damage < chr->maxdamage)) { f32 endframe = -1; if (!chrIsAnimPreventingArgh(chr, &endframe)) { @@ -5090,14 +5090,14 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho chr->act_preargh.relshotdir = angle; chr->act_preargh.hitpart = hitpart; chr->act_preargh.aplayernum = aplayernum; - chr->act_preargh.hand.weaponnum = hand->weaponnum; - chr->act_preargh.hand.unk0639 = hand->unk0639; - chr->act_preargh.hand.unk063a = hand->unk063a; - chr->act_preargh.hand.weaponfunc = hand->weaponfunc; + chr->act_preargh.gset.weaponnum = gset->weaponnum; + chr->act_preargh.gset.unk0639 = gset->unk0639; + chr->act_preargh.gset.unk063a = gset->unk063a; + chr->act_preargh.gset.weaponfunc = gset->weaponfunc; chr->sleep = 0; } else { - chrReactToDamage(chr, vector, angle, hitpart, hand, aplayernum); + chrReactToDamage(chr, vector, angle, hitpart, gset, aplayernum); } } } @@ -9020,12 +9020,12 @@ bool chrDropItem(struct chrdata *chr, u32 modelnum, u32 weaponnum) void chrPunchInflictDamage(struct chrdata *chr, s32 damage, s32 range, u8 reverse) { struct prop *targetprop = chrGetTargetProp(chr); - struct shorthand hand = {WEAPON_UNARMED, 0, 0, FUNC_PRIMARY}; + struct gset gset = {WEAPON_UNARMED, 0, 0, FUNC_PRIMARY}; struct coord vector; if (chr->aibot) { - hand.weaponnum = chr->aibot->weaponnum; - hand.weaponfunc = chr->aibot->gunfunc; + gset.weaponnum = chr->aibot->weaponnum; + gset.weaponfunc = chr->aibot->gunfunc; } if (chrIsTargetInFov(chr, 20, reverse) @@ -9037,14 +9037,14 @@ void chrPunchInflictDamage(struct chrdata *chr, s32 damage, s32 range, u8 revers guNormalize(&vector.x, &vector.y, &vector.z); - handPlayPropHitSound(&hand, targetprop, -1); + gsetPlayPropHitSound(&gset, targetprop, -1); if (targetprop->type == PROPTYPE_PLAYER || targetprop->type == PROPTYPE_CHR) { - chrDamageByImpact(targetprop->chr, handGetDamage(&hand) * damage, &vector, &hand, chr->prop, 200); + chrDamageByImpact(targetprop->chr, gsetGetDamage(&gset) * damage, &vector, &gset, chr->prop, 200); } } - weaponPlayWhooshSound(hand.weaponnum, chr->prop); + weaponPlayWhooshSound(gset.weaponnum, chr->prop); } struct punchanim { @@ -10519,7 +10519,7 @@ void chrTickPreArgh(struct chrdata *chr) chrReactToDamage(chr, &dir, chr->act_preargh.relshotdir, chr->act_preargh.hitpart, - &chr->act_preargh.hand, + &chr->act_preargh.gset, chr->act_preargh.aplayernum); } } @@ -10636,10 +10636,10 @@ glabel func0f03e29c /* f03e2c8: 904e005c */ lbu $t6,0x5c($v0) /* f03e2cc: 2444005c */ addiu $a0,$v0,0x5c /* f03e2d0: afa4004c */ sw $a0,0x4c($sp) -/* f03e2d4: 0fc2c78a */ jal handGetSingleUnk38 +/* f03e2d4: 0fc2c78a */ jal gsetGetSingleUnk38 /* f03e2d8: afae005c */ sw $t6,0x5c($sp) /* f03e2dc: 8fa4004c */ lw $a0,0x4c($sp) -/* f03e2e0: 0fc2c79a */ jal handGetSingleShootSound +/* f03e2e0: 0fc2c79a */ jal gsetGetSingleShootSound /* f03e2e4: a3a20057 */ sb $v0,0x57($sp) /* f03e2e8: 8faa0068 */ lw $t2,0x68($sp) /* f03e2ec: 8faf006c */ lw $t7,0x6c($sp) @@ -10759,10 +10759,10 @@ glabel func0f03e29c /* f03dac8: 904e005c */ lbu $t6,0x5c($v0) /* f03dacc: 2444005c */ addiu $a0,$v0,0x5c /* f03dad0: afa40054 */ sw $a0,0x54($sp) -/* f03dad4: 0fc2bee2 */ jal handGetSingleUnk38 +/* f03dad4: 0fc2bee2 */ jal gsetGetSingleUnk38 /* f03dad8: afae0064 */ sw $t6,0x64($sp) /* f03dadc: 8fa40054 */ lw $a0,0x54($sp) -/* f03dae0: 0fc2bef2 */ jal handGetSingleShootSound +/* f03dae0: 0fc2bef2 */ jal gsetGetSingleShootSound /* f03dae4: a3a2005f */ sb $v0,0x5f($sp) /* f03dae8: 8faf0074 */ lw $t7,0x74($sp) /* f03daec: 3049ffff */ andi $t1,$v0,0xffff @@ -12300,7 +12300,7 @@ f32 chrGetAimLimitAngle(f32 sqdist) * is within range, and writes to the hit argument to indicate if the target is * being hit or not. */ -void chrCalculateHit(struct chrdata *chr, bool *angleokptr, bool *hit, struct shorthand *hand) +void chrCalculateHit(struct chrdata *chr, bool *angleokptr, bool *hit, struct gset *gset) { struct prop *prop; struct prop *target; @@ -12344,7 +12344,7 @@ void chrCalculateHit(struct chrdata *chr, bool *angleokptr, bool *hit, struct sh *hit = false; // Determine the distance at which accuracy starts to taper off - switch (hand->weaponnum) { + switch (gset->weaponnum) { case WEAPON_FALCON2: case WEAPON_FALCON2_SILENCER: case WEAPON_MAULER: @@ -12429,12 +12429,12 @@ void chrCalculateHit(struct chrdata *chr, bool *angleokptr, bool *hit, struct sh // If the weapon fires more than once per tick, double the value to // account for it. No weapons meet this criteria, however. - if (weaponGetNumTicksPerShot(hand->weaponnum, hand->weaponfunc) <= 0) { + if (weaponGetNumTicksPerShot(gset->weaponnum, gset->weaponfunc) <= 0) { accuracy += accuracy; } // Shotgun doubles the value due to more bullets - if (hand->weaponnum == WEAPON_SHOTGUN) { + if (gset->weaponnum == WEAPON_SHOTGUN) { accuracy += accuracy; } @@ -13936,7 +13936,7 @@ glabel var7f1a9184 /* f041590: 8faf01cc */ lw $t7,0x1cc($sp) /* f041594: 11c00065 */ beqz $t6,.PF0f04172c /* f041598: 00000000 */ nop -/* f04159c: 0fc2c87a */ jal handGetDamage +/* f04159c: 0fc2c87a */ jal gsetGetDamage /* f0415a0: 27a40260 */ addiu $a0,$sp,0x260 /* f0415a4: 8faa025c */ lw $t2,0x25c($sp) /* f0415a8: 240dffff */ li $t5,-1 @@ -13997,7 +13997,7 @@ glabel var7f1a9184 .PF0f041678: /* f041678: 27a40260 */ addiu $a0,$sp,0x260 /* f04167c: 8fa5025c */ lw $a1,0x25c($sp) -/* f041680: 0fc2a079 */ jal handPlayPropHitSound +/* f041680: 0fc2a079 */ jal gsetPlayPropHitSound /* f041684: 2406ffff */ li $a2,-1 /* f041688: 8fa40088 */ lw $a0,0x88($sp) /* f04168c: 8c8b0020 */ lw $t3,0x20($a0) @@ -14094,14 +14094,14 @@ glabel var7f1a9184 /* f0417d8: afa00080 */ sw $zero,0x80($sp) /* f0417dc: afb8007c */ sw $t8,0x7c($sp) /* f0417e0: afac0078 */ sw $t4,0x78($sp) -/* f0417e4: 0fc2c87a */ jal handGetDamage +/* f0417e4: 0fc2c87a */ jal gsetGetDamage /* f0417e8: 27a40260 */ addiu $a0,$sp,0x260 /* f0417ec: 8fa501cc */ lw $a1,0x1cc($sp) /* f0417f0: e7a00074 */ swc1 $f0,0x74($sp) /* f0417f4: 27a40260 */ addiu $a0,$sp,0x260 /* f0417f8: 8cad0004 */ lw $t5,0x4($a1) /* f0417fc: 2406ffff */ li $a2,-1 -/* f041800: 0fc2a079 */ jal handPlayPropHitSound +/* f041800: 0fc2a079 */ jal gsetPlayPropHitSound /* f041804: afad0070 */ sw $t5,0x70($sp) /* f041808: 8fa40070 */ lw $a0,0x70($sp) /* f04180c: 8c990020 */ lw $t9,0x20($a0) @@ -14181,7 +14181,7 @@ glabel var7f1a9184 .PF0f041920: /* f041920: 27a40260 */ addiu $a0,$sp,0x260 /* f041924: 8fa501cc */ lw $a1,0x1cc($sp) -/* f041928: 0fc2a079 */ jal handPlayPropHitSound +/* f041928: 0fc2a079 */ jal gsetPlayPropHitSound /* f04192c: 2406ffff */ li $a2,-1 /* f041930: 27a40244 */ addiu $a0,$sp,0x244 /* f041934: 27a50234 */ addiu $a1,$sp,0x234 @@ -14227,7 +14227,7 @@ glabel var7f1a9184 /* f0419cc: 5540002e */ bnezl $t2,.PF0f041a88 /* f0419d0: 93ad0260 */ lbu $t5,0x260($sp) .PF0f0419d4: -/* f0419d4: 0fc2c87a */ jal handGetDamage +/* f0419d4: 0fc2c87a */ jal gsetGetDamage /* f0419d8: 27a40260 */ addiu $a0,$sp,0x260 /* f0419dc: 8faf0068 */ lw $t7,0x68($sp) /* f0419e0: 44050000 */ mfc1 $a1,$f0 @@ -15526,7 +15526,7 @@ glabel var7f1a9184 /* f0413ec: 8faa01cc */ lw $t2,0x1cc($sp) /* f0413f0: 13200065 */ beqz $t9,.L0f041588 /* f0413f4: 00000000 */ nop -/* f0413f8: 0fc2c74a */ jal handGetDamage +/* f0413f8: 0fc2c74a */ jal gsetGetDamage /* f0413fc: 27a40260 */ addiu $a0,$sp,0x260 /* f041400: 8fab025c */ lw $t3,0x25c($sp) /* f041404: 240cffff */ addiu $t4,$zero,-1 @@ -15587,7 +15587,7 @@ glabel var7f1a9184 .L0f0414d4: /* f0414d4: 27a40260 */ addiu $a0,$sp,0x260 /* f0414d8: 8fa5025c */ lw $a1,0x25c($sp) -/* f0414dc: 0fc29f66 */ jal handPlayPropHitSound +/* f0414dc: 0fc29f66 */ jal gsetPlayPropHitSound /* f0414e0: 2406ffff */ addiu $a2,$zero,-1 /* f0414e4: 8fa40088 */ lw $a0,0x88($sp) /* f0414e8: 8c8e0020 */ lw $t6,0x20($a0) @@ -15684,14 +15684,14 @@ glabel var7f1a9184 /* f041634: afa00080 */ sw $zero,0x80($sp) /* f041638: afaf007c */ sw $t7,0x7c($sp) /* f04163c: afb80078 */ sw $t8,0x78($sp) -/* f041640: 0fc2c74a */ jal handGetDamage +/* f041640: 0fc2c74a */ jal gsetGetDamage /* f041644: 27a40260 */ addiu $a0,$sp,0x260 /* f041648: 8fa501cc */ lw $a1,0x1cc($sp) /* f04164c: e7a00074 */ swc1 $f0,0x74($sp) /* f041650: 27a40260 */ addiu $a0,$sp,0x260 /* f041654: 8cac0004 */ lw $t4,0x4($a1) /* f041658: 2406ffff */ addiu $a2,$zero,-1 -/* f04165c: 0fc29f66 */ jal handPlayPropHitSound +/* f04165c: 0fc29f66 */ jal gsetPlayPropHitSound /* f041660: afac0070 */ sw $t4,0x70($sp) /* f041664: 8fa40070 */ lw $a0,0x70($sp) /* f041668: 8c8d0020 */ lw $t5,0x20($a0) @@ -15771,7 +15771,7 @@ glabel var7f1a9184 .L0f04177c: /* f04177c: 27a40260 */ addiu $a0,$sp,0x260 /* f041780: 8fa501cc */ lw $a1,0x1cc($sp) -/* f041784: 0fc29f66 */ jal handPlayPropHitSound +/* f041784: 0fc29f66 */ jal gsetPlayPropHitSound /* f041788: 2406ffff */ addiu $a2,$zero,-1 /* f04178c: 27a40244 */ addiu $a0,$sp,0x244 /* f041790: 27a50234 */ addiu $a1,$sp,0x234 @@ -15817,7 +15817,7 @@ glabel var7f1a9184 /* f041828: 5560002e */ bnezl $t3,.L0f0418e4 /* f04182c: 93ac0260 */ lbu $t4,0x260($sp) .L0f041830: -/* f041830: 0fc2c74a */ jal handGetDamage +/* f041830: 0fc2c74a */ jal gsetGetDamage /* f041834: 27a40260 */ addiu $a0,$sp,0x260 /* f041838: 8faa0068 */ lw $t2,0x68($sp) /* f04183c: 44050000 */ mfc1 $a1,$f0 @@ -17110,7 +17110,7 @@ glabel var7f1a9184 /* f040bb4: 8fad01cc */ lw $t5,0x1cc($sp) /* f040bb8: 13000065 */ beqz $t8,.NB0f040d50 /* f040bbc: 00000000 */ sll $zero,$zero,0x0 -/* f040bc0: 0fc2bea2 */ jal handGetDamage +/* f040bc0: 0fc2bea2 */ jal gsetGetDamage /* f040bc4: 27a40260 */ addiu $a0,$sp,0x260 /* f040bc8: 8fae025c */ lw $t6,0x25c($sp) /* f040bcc: 2419ffff */ addiu $t9,$zero,-1 @@ -17171,7 +17171,7 @@ glabel var7f1a9184 .NB0f040c9c: /* f040c9c: 27a40260 */ addiu $a0,$sp,0x260 /* f040ca0: 8fa5025c */ lw $a1,0x25c($sp) -/* f040ca4: 0fc296b1 */ jal handPlayPropHitSound +/* f040ca4: 0fc296b1 */ jal gsetPlayPropHitSound /* f040ca8: 2406ffff */ addiu $a2,$zero,-1 /* f040cac: 8fa40088 */ lw $a0,0x88($sp) /* f040cb0: 8c8c0020 */ lw $t4,0x20($a0) @@ -17268,14 +17268,14 @@ glabel var7f1a9184 /* f040dfc: afa00080 */ sw $zero,0x80($sp) /* f040e00: afaa007c */ sw $t2,0x7c($sp) /* f040e04: afaf0078 */ sw $t7,0x78($sp) -/* f040e08: 0fc2bea2 */ jal handGetDamage +/* f040e08: 0fc2bea2 */ jal gsetGetDamage /* f040e0c: 27a40260 */ addiu $a0,$sp,0x260 /* f040e10: 8fa501cc */ lw $a1,0x1cc($sp) /* f040e14: e7a00074 */ swc1 $f0,0x74($sp) /* f040e18: 27a40260 */ addiu $a0,$sp,0x260 /* f040e1c: 8cb90004 */ lw $t9,0x4($a1) /* f040e20: 2406ffff */ addiu $a2,$zero,-1 -/* f040e24: 0fc296b1 */ jal handPlayPropHitSound +/* f040e24: 0fc296b1 */ jal gsetPlayPropHitSound /* f040e28: afb90070 */ sw $t9,0x70($sp) /* f040e2c: 8fa40070 */ lw $a0,0x70($sp) /* f040e30: 8c8b0020 */ lw $t3,0x20($a0) @@ -17355,7 +17355,7 @@ glabel var7f1a9184 .NB0f040f44: /* f040f44: 27a40260 */ addiu $a0,$sp,0x260 /* f040f48: 8fa501cc */ lw $a1,0x1cc($sp) -/* f040f4c: 0fc296b1 */ jal handPlayPropHitSound +/* f040f4c: 0fc296b1 */ jal gsetPlayPropHitSound /* f040f50: 2406ffff */ addiu $a2,$zero,-1 /* f040f54: 27a40244 */ addiu $a0,$sp,0x244 /* f040f58: 27a50234 */ addiu $a1,$sp,0x234 @@ -17401,7 +17401,7 @@ glabel var7f1a9184 /* f040ff0: 55c0002e */ bnezl $t6,.NB0f0410ac /* f040ff4: 93b90260 */ lbu $t9,0x260($sp) .NB0f040ff8: -/* f040ff8: 0fc2bea2 */ jal handGetDamage +/* f040ff8: 0fc2bea2 */ jal gsetGetDamage /* f040ffc: 27a40260 */ addiu $a0,$sp,0x260 /* f041000: 8fad0068 */ lw $t5,0x68($sp) /* f041004: 44050000 */ mfc1 $a1,$f0 diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index 16abd8098..f3b8caa47 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -812,8 +812,8 @@ bool ai0019(void) struct coord pos = {0, 0, 0}; if (chr && chr->prop) { - f32 damage = handGetDamage((struct shorthand *)&cmd[4]); - chrDamageByImpact(chr, damage, &pos, (struct shorthand *)&cmd[4], NULL, (s8)cmd[3]); + f32 damage = gsetGetDamage((struct gset *)&cmd[4]); + chrDamageByImpact(chr, damage, &pos, (struct gset *)&cmd[4], NULL, (s8)cmd[3]); } g_Vars.aioffset += 8; @@ -846,8 +846,8 @@ bool aiChrDamageChr(void) vector.z = chr2->prop->pos.z - chr1->prop->pos.z; guNormalize(&vector.x, &vector.y, &vector.z); weapon = prop->weapon; - damage = handGetDamage((struct shorthand *)&weapon->weaponnum); - chrDamageByImpact(chr2, damage, &vector, (struct shorthand *)&weapon->weaponnum, chr1->prop, (s8)cmd[4]); + damage = gsetGetDamage((struct gset *)&weapon->weaponnum); + chrDamageByImpact(chr2, damage, &vector, (struct gset *)&weapon->weaponnum, chr1->prop, (s8)cmd[4]); } } @@ -10739,8 +10739,8 @@ bool aiDamageChrByAmount(void) if (chr && chr->prop) { if (cmd[4] == 2) { - struct shorthand hand = {WEAPON_COMBATKNIFE, 0, 0, FUNC_POISON}; - chrDamageByMisc(chr, (s32)cmd[3] * 0.03125f, &coord, &hand, NULL); + struct gset gset = {WEAPON_COMBATKNIFE, 0, 0, FUNC_POISON}; + chrDamageByMisc(chr, (s32)cmd[3] * 0.03125f, &coord, &gset, NULL); } else if (cmd[4] == 0) { chrDamageByMisc(chr, (s32)cmd[3] * 0.03125f, &coord, NULL, NULL); } else { diff --git a/src/game/game_097ba0.c b/src/game/game_097ba0.c index 53cc22d0f..c98d37afc 100644 --- a/src/game/game_097ba0.c +++ b/src/game/game_097ba0.c @@ -402,7 +402,7 @@ bool func0f097df0(struct inventory_typef *arg0, struct hand *hand) switch (arg0->unk00) { case 4: - if (((hand->base.unk0639 >> arg0->unk02) & 1) == 0) { + if (((hand->gset.unk0639 >> arg0->unk02) & 1) == 0) { result = false; } break; @@ -484,7 +484,7 @@ void func0f097f28(struct hand *hand, struct modelfiledata *filedata, struct inve void func0f098030(struct hand *hand, struct modelfiledata *arg1) { - struct weapon *weapon = weaponFindById(hand->base.weaponnum); + struct weapon *weapon = weaponFindById(hand->gset.weaponnum); s32 i; s32 j; @@ -2027,7 +2027,7 @@ glabel var7f1ac1b0 ); #endif -bool func0f098884(struct guncmd *cmd, struct shorthand *hand) +bool func0f098884(struct guncmd *cmd, struct gset *gset) { s32 result = false; @@ -2039,7 +2039,7 @@ bool func0f098884(struct guncmd *cmd, struct shorthand *hand) result = true; } - if (cmd->unk01 == 2 && hand->weaponfunc == FUNC_SECONDARY) { + if (cmd->unk01 == 2 && gset->weaponfunc == FUNC_SECONDARY) { result = true; } @@ -2054,7 +2054,7 @@ void func0f0988e0(struct guncmd *cmd, s32 handnum, struct hand *hand) u32 rand = random() % 100; while (loopcmd->type != GUNCMD_END) { - if (func0f098884(loopcmd, &hand->base) && !done) { + if (func0f098884(loopcmd, &hand->gset) && !done) { if (loopcmd->type == GUNCMD_INCLUDE) { done = true; func0f0988e0((struct guncmd *)loopcmd->unk04, handnum, hand); @@ -2185,7 +2185,7 @@ void handGetWeaponInfo(struct handweaponinfo *info, s32 handnum) s32 func0f098ca0(s32 funcnum, struct handweaponinfo *info, struct hand *hand) { s32 result = 3; - struct weaponfunc *func = weaponGetFunction(&hand->base, funcnum); + struct weaponfunc *func = weaponGetFunction(&hand->gset, funcnum); if (!func) { return -1; @@ -2457,7 +2457,7 @@ void func0f098f8c(struct handweaponinfo *info, struct hand *hand) s32 i; for (i = 0; i < 2; i++) { - if (weaponGetFunction(&hand->base, i)) { + if (weaponGetFunction(&hand->gset, i)) { func0f098df8(i, info, hand, 0, 1); } } @@ -2521,8 +2521,8 @@ bool func0f0990b0(struct weaponfunc *basefunc, struct weapon *weapon) bool func0f099188(struct hand *hand, s32 gunfunc) { - struct weaponfunc *func = weaponGetFunction(&hand->base, gunfunc); - struct weapon *weapon = weaponFindById(hand->base.weaponnum); + struct weaponfunc *func = weaponGetFunction(&hand->gset, gunfunc); + struct weapon *weapon = weaponFindById(hand->gset.weaponnum); if (currentPlayerIsUsingSecondaryFunction() == gunfunc) { return false; @@ -3337,20 +3337,20 @@ glabel handTickIncIdle // return lvupdate; // } // -// if (gunfunc == hand->base.weaponfunc) { +// if (gunfunc == hand->gset.weaponfunc) { // hand->unk0cc8_07 = false; // } // // hand->unk0cc8_08 = false; // // if (hand->inuse) { -// sp34 = func0f098ca0(hand->base.weaponfunc, info, hand); +// sp34 = func0f098ca0(hand->gset.weaponfunc, info, hand); // // // Handle changing gun function -// if (gunfunc != hand->base.weaponfunc && hand->modenext != HANDMODE_RELOAD) { +// if (gunfunc != hand->gset.weaponfunc && hand->modenext != HANDMODE_RELOAD) { // changefunc = true; // -// if (hand->unk0cc8_07 && func0f098ca0(1 - hand->base.weaponfunc, info, hand) < 0) { +// if (hand->unk0cc8_07 && func0f098ca0(1 - hand->gset.weaponfunc, info, hand) < 0) { // changefunc = false; // } // @@ -3358,7 +3358,7 @@ glabel handTickIncIdle // if (sp34 == 0) { // hand->count60 = 0; // hand->count = 0; -// hand->base.weaponfunc = gunfunc; +// hand->gset.weaponfunc = gunfunc; // // if (handSetState(handnum, HANDSTATE_RELOAD)) { // return lvupdate; @@ -3395,12 +3395,12 @@ glabel handTickIncIdle // && (g_MpPlayers[g_Vars.currentplayerstats->mpindex].gunfuncs[(g_Vars.currentplayer->gunctrl.weaponnum - 1) >> 3] & (1 << (g_Vars.currentplayer->gunctrl.weaponnum - 1 & 7))); // // if (usesec == gunfunc) { -// sp30 = func0f098ca0(1 - hand->base.weaponfunc, info, hand); +// sp30 = func0f098ca0(1 - hand->gset.weaponfunc, info, hand); // -// if (func0f099188(hand, 1 - hand->base.weaponfunc) +// if (func0f099188(hand, 1 - hand->gset.weaponfunc) // && info->weaponnum != WEAPON_REAPER) { // if (info->gunctrl->wantammo) { -// func = weaponGetFunction(&hand->base, 1 - hand->base.weaponfunc); +// func = weaponGetFunction(&hand->gset, 1 - hand->gset.weaponfunc); // // if ((func->type & 0xff) != INVENTORYFUNCTYPE_CLOSE) { // sp30 = -1; @@ -3414,7 +3414,7 @@ glabel handTickIncIdle // hand->unk0cc8_08 = true; // } else { // if (!weaponHasFlag(info->weaponnum, WEAPONFLAG_04000000) -// || hand->base.weaponfunc == FUNC_SECONDARY) { +// || hand->gset.weaponfunc == FUNC_SECONDARY) { // hand->unk0cc8_07 = true; // // if (handSetState(handnum, HANDSTATE_CHANGEFUNC)) { @@ -3441,7 +3441,7 @@ glabel handTickIncIdle // } // } else { // // Clip has ammo -// if (hand->triggeron || (hand->unk0d0f_03 && hand->base.weaponfunc == FUNC_SECONDARY)) { +// if (hand->triggeron || (hand->unk0d0f_03 && hand->gset.weaponfunc == FUNC_SECONDARY)) { // if (info->weaponnum != WEAPON_NONE) { // g_Vars.currentplayer->doautoselect = false; // @@ -3556,11 +3556,11 @@ s32 handTickIncAutoSwitch(struct handweaponinfo *info, s32 handnum, struct hand someval = func0f098ca0(gunfunc, info, hand); if (info->weaponnum == WEAPON_TIMEDMINE || info->weaponnum == WEAPON_PROXIMITYMINE) { - hand->base.weaponfunc = gunfunc; + hand->gset.weaponfunc = gunfunc; } if (info->weaponnum == WEAPON_REMOTEMINE - && gunfunc != hand->base.weaponfunc + && gunfunc != hand->gset.weaponfunc && handSetState(handnum, HANDSTATE_CHANGEFUNC)) { return lvupdate; } @@ -3581,7 +3581,7 @@ s32 handTickIncAutoSwitch(struct handweaponinfo *info, s32 handnum, struct hand ready = false; } - if (func0f099188(otherhand, otherhand->base.weaponfunc)) { + if (func0f099188(otherhand, otherhand->gset.weaponfunc)) { ready = true; } } @@ -3829,7 +3829,7 @@ glabel var7f1ac31c /* f099c58: 00c08025 */ or $s0,$a2,$zero /* f099c5c: afa5003c */ sw $a1,0x3c($sp) /* f099c60: afa70044 */ sw $a3,0x44($sp) -/* f099c64: 0fc2c41f */ jal handGetWeaponFunction +/* f099c64: 0fc2c41f */ jal gsetGetWeaponFunction /* f099c68: 00c02025 */ or $a0,$a2,$zero /* f099c6c: 3c0e800a */ lui $t6,%hi(g_Vars+0x284) /* f099c70: 8dcea244 */ lw $t6,%lo(g_Vars+0x284)($t6) @@ -4489,7 +4489,7 @@ glabel var7f1ac31c /* f099c58: 00c08025 */ or $s0,$a2,$zero /* f099c5c: afa5003c */ sw $a1,0x3c($sp) /* f099c60: afa70044 */ sw $a3,0x44($sp) -/* f099c64: 0fc2c41f */ jal handGetWeaponFunction +/* f099c64: 0fc2c41f */ jal gsetGetWeaponFunction /* f099c68: 00c02025 */ or $a0,$a2,$zero /* f099c6c: 3c0e800a */ lui $t6,%hi(g_Vars+0x284) /* f099c70: 8dcea244 */ lw $t6,%lo(g_Vars+0x284)($t6) @@ -5147,7 +5147,7 @@ glabel var7f1ac31c /* f099c58: 00c08025 */ or $s0,$a2,$zero /* f099c5c: afa5003c */ sw $a1,0x3c($sp) /* f099c60: afa70044 */ sw $a3,0x44($sp) -/* f099c64: 0fc2c41f */ jal handGetWeaponFunction +/* f099c64: 0fc2c41f */ jal gsetGetWeaponFunction /* f099c68: 00c02025 */ or $a0,$a2,$zero /* f099c6c: 3c0e800a */ lui $t6,%hi(g_Vars+0x284) /* f099c70: 8dcea244 */ lw $t6,%lo(g_Vars+0x284)($t6) @@ -5620,7 +5620,7 @@ glabel var7f1ac31c // Mismatch: Branch logic near e9c is different (but functionally the same) //s32 handTickIncReload(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate) //{ -// struct weaponfunc *func = handGetWeaponFunction(&hand->base); +// struct weaponfunc *func = gsetGetWeaponFunction(&hand->gset); // // if (g_Vars.currentplayer->isdead) { // hand->animmode = HANDANIMMODE_IDLE; @@ -5689,9 +5689,9 @@ glabel var7f1ac31c // if ((hand->stateflags & HANDSTATEFLAG_00000010) == 0) { // s32 value; // -// func0f098df8(hand->base.weaponfunc, info, hand, 1, 0); +// func0f098df8(hand->gset.weaponfunc, info, hand, 1, 0); // hand->stateflags |= HANDSTATEFLAG_00000010; -// value = func0f098ca0(hand->base.weaponfunc, info, hand); +// value = func0f098ca0(hand->gset.weaponfunc, info, hand); // // if (value >= 2) { // hand->unk0cc8_03 = false; @@ -5711,7 +5711,7 @@ glabel var7f1ac31c // } else { // if ((hand->stateflags & HANDSTATEFLAG_00000010) == 0) { // if (func0f098a44(hand, 1)) { -// func0f098df8(hand->base.weaponfunc, info, hand, 0, 0); +// func0f098df8(hand->gset.weaponfunc, info, hand, 0, 0); // hand->stateflags |= HANDSTATEFLAG_00000010; // } // } @@ -5749,7 +5749,7 @@ glabel var7f1ac31c // } // // if ((hand->stateflags & HANDSTATEFLAG_00000010) == 0) { -// func0f098df8(hand->base.weaponfunc, info, hand, 0, 0); +// func0f098df8(hand->gset.weaponfunc, info, hand, 0, 0); // } // // if (g_Vars.lvupdate240 > 0 @@ -5823,12 +5823,12 @@ s32 handTickIncChangeFunc(struct handweaponinfo *info, s32 handnum, struct hand bool more = false; if (hand->statecycles == 0) { - if (hand->base.weaponfunc == FUNC_PRIMARY) { - cmd = handGetPriToSecAnim(&hand->base); - hand->base.weaponfunc = FUNC_SECONDARY; + if (hand->gset.weaponfunc == FUNC_PRIMARY) { + cmd = gsetGetPriToSecAnim(&hand->gset); + hand->gset.weaponfunc = FUNC_SECONDARY; } else { - cmd = handGetSecToPriAnim(&hand->base); - hand->base.weaponfunc = FUNC_PRIMARY; + cmd = gsetGetSecToPriAnim(&hand->gset); + hand->gset.weaponfunc = FUNC_PRIMARY; } more = false; @@ -5918,7 +5918,7 @@ s32 func0f09a3f8(struct hand *hand, struct weaponfunc *func) if (hand->burstbullets > 0) { s32 delay = 3; - if (hand->base.weaponnum == WEAPON_SHOTGUN) { + if (hand->gset.weaponnum == WEAPON_SHOTGUN) { delay = PALDOWN(13); } @@ -6137,7 +6137,7 @@ glabel var7f1ac320 .L0f09a920: /* f09a920: 1040009b */ beqz $v0,.L0f09ab90 /* f09a924: 02002025 */ or $a0,$s0,$zero -/* f09a928: 0fc2c78a */ jal handGetSingleUnk38 +/* f09a928: 0fc2c78a */ jal gsetGetSingleUnk38 /* f09a92c: afa00044 */ sw $zero,0x44($sp) /* f09a930: 1840001e */ blez $v0,.L0f09a9ac /* f09a934: 8fa30044 */ lw $v1,0x44($sp) @@ -6162,7 +6162,7 @@ glabel var7f1ac320 /* f09a980: 01e2082a */ slt $at,$t7,$v0 /* f09a984: 1020000d */ beqz $at,.L0f09a9bc /* f09a988: 00000000 */ nop -/* f09a98c: 0fc2c78a */ jal handGetSingleUnk38 +/* f09a98c: 0fc2c78a */ jal gsetGetSingleUnk38 /* f09a990: 02002025 */ or $a0,$s0,$zero /* f09a994: 3c18800a */ lui $t8,%hi(g_Vars+0x8) /* f09a998: 8f189fc8 */ lw $t8,%lo(g_Vars+0x8)($t8) @@ -6207,7 +6207,7 @@ glabel var7f1ac320 /* f09aa28: 0c00cec9 */ jal audioStop /* f09aa2c: 8e0401d0 */ lw $a0,0x1d0($s0) .L0f09aa30: -/* f09aa30: 0fc2c79a */ jal handGetSingleShootSound +/* f09aa30: 0fc2c79a */ jal gsetGetSingleShootSound /* f09aa34: 02002025 */ or $a0,$s0,$zero /* f09aa38: 50400053 */ beqzl $v0,.L0f09ab88 /* f09aa3c: 00002025 */ or $a0,$zero,$zero @@ -6215,7 +6215,7 @@ glabel var7f1ac320 /* f09aa44: 00002025 */ or $a0,$zero,$zero /* f09aa48: 55400017 */ bnezl $t2,.L0f09aaa8 /* f09aa4c: 8e0e01d0 */ lw $t6,0x1d0($s0) -/* f09aa50: 0fc2c79a */ jal handGetSingleShootSound +/* f09aa50: 0fc2c79a */ jal gsetGetSingleShootSound /* f09aa54: 02002025 */ or $a0,$s0,$zero /* f09aa58: 3c01bf80 */ lui $at,0xbf80 /* f09aa5c: 44814000 */ mtc1 $at,$f8 @@ -6240,7 +6240,7 @@ glabel var7f1ac320 .L0f09aaa8: /* f09aaa8: 55c00016 */ bnezl $t6,.L0f09ab04 /* f09aaac: 920b0000 */ lbu $t3,0x0($s0) -/* f09aab0: 0fc2c79a */ jal handGetSingleShootSound +/* f09aab0: 0fc2c79a */ jal gsetGetSingleShootSound /* f09aab4: 02002025 */ or $a0,$s0,$zero /* f09aab8: 3c01bf80 */ lui $at,0xbf80 /* f09aabc: 44815000 */ mtc1 $at,$f10 @@ -6467,7 +6467,7 @@ glabel var7f1ac320 .L0f09a920: /* f09a920: 1040009b */ beqz $v0,.L0f09ab90 /* f09a924: 02002025 */ or $a0,$s0,$zero -/* f09a928: 0fc2c78a */ jal handGetSingleUnk38 +/* f09a928: 0fc2c78a */ jal gsetGetSingleUnk38 /* f09a92c: afa00044 */ sw $zero,0x44($sp) /* f09a930: 1840001e */ blez $v0,.L0f09a9ac /* f09a934: 8fa30044 */ lw $v1,0x44($sp) @@ -6492,7 +6492,7 @@ glabel var7f1ac320 /* f09a980: 01e2082a */ slt $at,$t7,$v0 /* f09a984: 1020000d */ beqz $at,.L0f09a9bc /* f09a988: 00000000 */ nop -/* f09a98c: 0fc2c78a */ jal handGetSingleUnk38 +/* f09a98c: 0fc2c78a */ jal gsetGetSingleUnk38 /* f09a990: 02002025 */ or $a0,$s0,$zero /* f09a994: 3c18800a */ lui $t8,%hi(g_Vars+0x8) /* f09a998: 8f189fc8 */ lw $t8,%lo(g_Vars+0x8)($t8) @@ -6537,7 +6537,7 @@ glabel var7f1ac320 /* f09aa28: 0c00cec9 */ jal audioStop /* f09aa2c: 8e0401d0 */ lw $a0,0x1d0($s0) .L0f09aa30: -/* f09aa30: 0fc2c79a */ jal handGetSingleShootSound +/* f09aa30: 0fc2c79a */ jal gsetGetSingleShootSound /* f09aa34: 02002025 */ or $a0,$s0,$zero /* f09aa38: 50400053 */ beqzl $v0,.L0f09ab88 /* f09aa3c: 00002025 */ or $a0,$zero,$zero @@ -6545,7 +6545,7 @@ glabel var7f1ac320 /* f09aa44: 00002025 */ or $a0,$zero,$zero /* f09aa48: 55400017 */ bnezl $t2,.L0f09aaa8 /* f09aa4c: 8e0e01d0 */ lw $t6,0x1d0($s0) -/* f09aa50: 0fc2c79a */ jal handGetSingleShootSound +/* f09aa50: 0fc2c79a */ jal gsetGetSingleShootSound /* f09aa54: 02002025 */ or $a0,$s0,$zero /* f09aa58: 3c01bf80 */ lui $at,0xbf80 /* f09aa5c: 44814000 */ mtc1 $at,$f8 @@ -6570,7 +6570,7 @@ glabel var7f1ac320 .L0f09aaa8: /* f09aaa8: 55c00016 */ bnezl $t6,.L0f09ab04 /* f09aaac: 920b0000 */ lbu $t3,0x0($s0) -/* f09aab0: 0fc2c79a */ jal handGetSingleShootSound +/* f09aab0: 0fc2c79a */ jal gsetGetSingleShootSound /* f09aab4: 02002025 */ or $a0,$s0,$zero /* f09aab8: 3c01bf80 */ lui $at,0xbf80 /* f09aabc: 44815000 */ mtc1 $at,$f10 @@ -6797,7 +6797,7 @@ glabel var7f1ac320 .NB0f09895c: /* f09895c: 1040008f */ beqz $v0,.NB0f098b9c /* f098960: 02002025 */ or $a0,$s0,$zero -/* f098964: 0fc2bee2 */ jal handGetSingleUnk38 +/* f098964: 0fc2bee2 */ jal gsetGetSingleUnk38 /* f098968: afa0003c */ sw $zero,0x3c($sp) /* f09896c: 1840001e */ blez $v0,.NB0f0989e8 /* f098970: 8fa3003c */ lw $v1,0x3c($sp) @@ -6822,7 +6822,7 @@ glabel var7f1ac320 /* f0989bc: 01e2082a */ slt $at,$t7,$v0 /* f0989c0: 1020000d */ beqz $at,.NB0f0989f8 /* f0989c4: 00000000 */ sll $zero,$zero,0x0 -/* f0989c8: 0fc2bee2 */ jal handGetSingleUnk38 +/* f0989c8: 0fc2bee2 */ jal gsetGetSingleUnk38 /* f0989cc: 02002025 */ or $a0,$s0,$zero /* f0989d0: 3c18800a */ lui $t8,0x800a /* f0989d4: 8f18e6c8 */ lw $t8,-0x1938($t8) @@ -6858,7 +6858,7 @@ glabel var7f1ac320 /* f098a40: 0c00d428 */ jal audioStop /* f098a44: 8e0401d0 */ lw $a0,0x1d0($s0) .NB0f098a48: -/* f098a48: 0fc2bef2 */ jal handGetSingleShootSound +/* f098a48: 0fc2bef2 */ jal gsetGetSingleShootSound /* f098a4c: 02002025 */ or $a0,$s0,$zero /* f098a50: 50400053 */ beqzl $v0,.NB0f098ba0 /* f098a54: 8fbf002c */ lw $ra,0x2c($sp) @@ -6866,7 +6866,7 @@ glabel var7f1ac320 /* f098a5c: 00002025 */ or $a0,$zero,$zero /* f098a60: 55400017 */ bnezl $t2,.NB0f098ac0 /* f098a64: 8e0e01d0 */ lw $t6,0x1d0($s0) -/* f098a68: 0fc2bef2 */ jal handGetSingleShootSound +/* f098a68: 0fc2bef2 */ jal gsetGetSingleShootSound /* f098a6c: 02002025 */ or $a0,$s0,$zero /* f098a70: 3c01bf80 */ lui $at,0xbf80 /* f098a74: 44814000 */ mtc1 $at,$f8 @@ -6891,7 +6891,7 @@ glabel var7f1ac320 .NB0f098ac0: /* f098ac0: 55c00016 */ bnezl $t6,.NB0f098b1c /* f098ac4: 920b0000 */ lbu $t3,0x0($s0) -/* f098ac8: 0fc2bef2 */ jal handGetSingleShootSound +/* f098ac8: 0fc2bef2 */ jal gsetGetSingleShootSound /* f098acc: 02002025 */ or $a0,$s0,$zero /* f098ad0: 3c01bf80 */ lui $at,0xbf80 /* f098ad4: 44815000 */ mtc1 $at,$f10 @@ -6996,7 +6996,7 @@ const char var7f1ab898[] = "rofftime"; // } else { // hand->shotstotake = 1; // -// if (hand->base.weaponnum == WEAPON_LASER) { +// if (hand->gset.weaponnum == WEAPON_LASER) { // usesammo = false; // } // } @@ -7044,10 +7044,10 @@ const char var7f1ab898[] = "rofftime"; // if (hand->firing) { // bool playsound = false; // -// if (handGetSingleUnk38(&hand->base) > 0) { +// if (gsetGetSingleUnk38(&hand->gset) > 0) { // if (g_Vars.lvframe60 != g_Vars.currentplayer->hands[1 - handnum].lastshootframe60 // && g_Vars.lvframe60 > hand->allowshootframe) { -// hand->allowshootframe = g_Vars.lvframe60 + handGetSingleUnk38(&hand->base); +// hand->allowshootframe = g_Vars.lvframe60 + gsetGetSingleUnk38(&hand->gset); // playsound = true; // } // } else { @@ -7072,13 +7072,13 @@ const char var7f1ab898[] = "rofftime"; // audioStop(hand->audiohandle3); // } // -// if (handGetSingleShootSound(&hand->base)) { +// if (gsetGetSingleShootSound(&hand->gset)) { // handle = NULL; // // if (hand->audiohandle2 == NULL) { -// handle = sndStart(var80095200, handGetSingleShootSound(&hand->base), &hand->audiohandle2, -1, -1, -1, -1, -1); +// handle = sndStart(var80095200, gsetGetSingleShootSound(&hand->gset), &hand->audiohandle2, -1, -1, -1, -1, -1); // } else if (hand->audiohandle3 == NULL) { -// handle = sndStart(var80095200, handGetSingleShootSound(&hand->base), &hand->audiohandle3, -1, -1, -1, -1, -1); +// handle = sndStart(var80095200, gsetGetSingleShootSound(&hand->gset), &hand->audiohandle3, -1, -1, -1, -1, -1); // } // } // @@ -7089,7 +7089,7 @@ const char var7f1ab898[] = "rofftime"; // * because the branch above (which clears handle) should always be // * taken for the Mauler. // */ -// if (hand->base.weaponnum == WEAPON_MAULER && handle) { +// if (hand->gset.weaponnum == WEAPON_MAULER && handle) { // f32 frac = (s32)hand->matmot1 / 3.0f; // f32 tmp; // @@ -7262,7 +7262,7 @@ bool handTickIncAttackingShoot(struct handweaponinfo *info, s32 handnum, struct { static u32 var80070128 = 99; - struct weaponfunc *func = handGetWeaponFunction(&hand->base); + struct weaponfunc *func = gsetGetWeaponFunction(&hand->gset); bool sp68; s32 sp64; s32 sp60; @@ -7339,7 +7339,7 @@ bool handTickIncAttackingShoot(struct handweaponinfo *info, s32 handnum, struct sp68 = true; } - if (hand->base.weaponnum == WEAPON_SHOTGUN && hand->animmode == HANDANIMMODE_BUSY) { + if (hand->gset.weaponnum == WEAPON_SHOTGUN && hand->animmode == HANDANIMMODE_BUSY) { sp68 = false; } @@ -7349,7 +7349,7 @@ bool handTickIncAttackingShoot(struct handweaponinfo *info, s32 handnum, struct hand->matmot2 = 0; } - if (hand->base.weaponnum == WEAPON_MAULER) { + if (hand->gset.weaponnum == WEAPON_MAULER) { hand->matmot1 = 0; } @@ -7361,7 +7361,7 @@ bool handTickIncAttackingShoot(struct handweaponinfo *info, s32 handnum, struct bool handTickIncAttackingThrow(s32 handnum, struct hand *hand) { - struct weaponfunc_throw *func = (struct weaponfunc_throw *) handGetWeaponFunction(&hand->base); + struct weaponfunc_throw *func = (struct weaponfunc_throw *) gsetGetWeaponFunction(&hand->gset); if (func == NULL) { return true; @@ -7370,7 +7370,7 @@ bool handTickIncAttackingThrow(s32 handnum, struct hand *hand) if (hand->stateminor == 0) { if (hand->statecycles == 0) { if (func->base.flags & FUNCFLAG_DISCARDWEAPON) { - invRemoveItemByNum(hand->base.weaponnum); + invRemoveItemByNum(hand->gset.weaponnum); g_Vars.currentplayer->gunctrl.unk1583_04 = true; #if VERSION >= VERSION_NTSC_1_0 func0f0a1ab0(); @@ -7414,7 +7414,7 @@ bool handTickIncAttackingThrow(s32 handnum, struct hand *hand) return true; } - if (hand->base.weaponnum == WEAPON_REMOTEMINE + if (hand->gset.weaponnum == WEAPON_REMOTEMINE && currentPlayerIsUsingSecondaryFunction() == true && hand->triggerreleased && hand->triggeron) { @@ -7440,8 +7440,8 @@ bool handTickIncAttackingThrow(s32 handnum, struct hand *hand) hand->primetimer = hand->stateframes; // If held a grenade too long, force throw it and enter the wait state - if (hand->base.weaponnum == WEAPON_GRENADE - && hand->base.weaponfunc == FUNC_PRIMARY + if (hand->gset.weaponnum == WEAPON_GRENADE + && hand->gset.weaponfunc == FUNC_PRIMARY && hand->primetimer > PALDOWN(func->activatetime60)) { hand->firing = true; hand->attacktype = HANDATTACKTYPE_THROWPROJECTILE; @@ -7700,13 +7700,13 @@ u32 var8007035c = 0x0029002a; bool handTickIncAttackingClose(s32 handnum, struct hand *hand) { - struct weaponfunc *func = handGetWeaponFunction(&hand->base); + struct weaponfunc *func = gsetGetWeaponFunction(&hand->gset); if (func == NULL) { return true; } - if (hand->base.weaponnum == WEAPON_REAPER) { + if (hand->gset.weaponnum == WEAPON_REAPER) { if (hand->statecycles == 0) { hand->matmot2 = 0.1f; hand->burstbullets = 0; @@ -7768,7 +7768,7 @@ bool handTickIncAttackingClose(s32 handnum, struct hand *hand) hand->firing = true; hand->attacktype = HANDATTACKTYPE_CLOSERANGE; - if (hand->base.weaponnum == WEAPON_TRANQUILIZER && func->ammoindex >= 0) { + if (hand->gset.weaponnum == WEAPON_TRANQUILIZER && func->ammoindex >= 0) { if (hand->loadedammo[func->ammoindex] > weaponGetMinClipQty(WEAPON_TRANQUILIZER, FUNC_SECONDARY)) { hand->loadedammo[func->ammoindex] -= weaponGetMinClipQty(WEAPON_TRANQUILIZER, FUNC_SECONDARY); } else { @@ -7796,7 +7796,7 @@ bool handTickIncAttackingClose(s32 handnum, struct hand *hand) return true; } - if (cheatIsActive(CHEAT_HURRICANEFISTS) && hand->base.weaponnum == WEAPON_UNARMED) { + if (cheatIsActive(CHEAT_HURRICANEFISTS) && hand->gset.weaponnum == WEAPON_UNARMED) { return true; } @@ -7812,7 +7812,7 @@ bool handTickIncAttackingClose(s32 handnum, struct hand *hand) bool handTickIncAttackingSpecial(struct hand *hand) { - struct weaponfunc_special *func = (struct weaponfunc_special *) handGetWeaponFunction(&hand->base); + struct weaponfunc_special *func = (struct weaponfunc_special *) gsetGetWeaponFunction(&hand->gset); if (!func) { return true; @@ -7883,7 +7883,7 @@ s32 handTickIncAttackEmpty(struct handweaponinfo *info, s32 handnum, struct hand struct weaponfunc *func = NULL; if (info->definition) { - func = handGetWeaponFunction(&hand->base); + func = gsetGetWeaponFunction(&hand->gset); } if (func && func->fire_animation) { @@ -8013,7 +8013,7 @@ s32 handTickIncAttack(struct handweaponinfo *info, s32 handnum, struct hand *han u32 stack2; if (info->definition) { - func = handGetWeaponFunction(&hand->base); + func = gsetGetWeaponFunction(&hand->gset); } if (func != NULL) { @@ -8034,8 +8034,8 @@ s32 handTickIncAttack(struct handweaponinfo *info, s32 handnum, struct hand *han } if (finished) { - if (hand->base.weaponnum == WEAPON_REAPER && hand->triggeron) { - hand->base.weaponfunc = FUNC_SECONDARY; + if (hand->gset.weaponnum == WEAPON_REAPER && hand->triggeron) { + hand->gset.weaponfunc = FUNC_SECONDARY; finished = false; } @@ -8056,7 +8056,7 @@ bool handIsReadyToSwitch(s32 handnum) // Dont switch if... something firing range related if (g_FrIsValidWeapon - && frGetWeaponBySlot(frGetSlot()) == player->hands[HAND_RIGHT].base.weaponnum + && frGetWeaponBySlot(frGetSlot()) == player->hands[HAND_RIGHT].gset.weaponnum && g_Vars.currentplayer->gunctrl.unk1583_04 == false) { return false; } @@ -8238,7 +8238,7 @@ s32 handTickIncChangeGun(struct handweaponinfo *info, s32 handnum, struct hand * if (g_Vars.currentplayer->gunctrl.unk1583_04 == 1 && hand->inuse) { hand->firing = true; hand->attacktype = HANDATTACKTYPE_THROWPROJECTILE; - hand->base.weaponfunc = FUNC_SECONDARY; + hand->gset.weaponfunc = FUNC_SECONDARY; } } } else { @@ -8287,7 +8287,7 @@ s32 handTickIncChangeGun(struct handweaponinfo *info, s32 handnum, struct hand * delay = PALDOWN(12); } - if (weaponHasFlag(hand->base.weaponnum, WEAPONFLAG_00004000)) { + if (weaponHasFlag(hand->gset.weaponnum, WEAPONFLAG_00004000)) { hand->animmode = HANDANIMMODE_IDLE; } else if (weapon->equip_animation) { delay = 1; @@ -8456,7 +8456,7 @@ s32 handTickIncChangeGun(struct handweaponinfo *info, s32 handnum, struct hand * hand->mode = HANDMODE_NONE; hand->stateminor++; - if (weaponHasFlag(hand->base.weaponnum, WEAPONFLAG_00004000) == 0) { + if (weaponHasFlag(hand->gset.weaponnum, WEAPONFLAG_00004000) == 0) { hand->unk0cc8_02 = false; } @@ -8469,7 +8469,7 @@ s32 handTickIncChangeGun(struct handweaponinfo *info, s32 handnum, struct hand * // Wait for equip animation to finish then go to idle state if (hand->stateminor == 4) { - if (info->definition->equip_animation && !weaponHasFlag(hand->base.weaponnum, WEAPONFLAG_00004000)) { + if (info->definition->equip_animation && !weaponHasFlag(hand->gset.weaponnum, WEAPONFLAG_00004000)) { if (hand->animmode == HANDANIMMODE_IDLE) { if (handSetState(handnum, HANDSTATE_IDLE)) { return lvupdate; @@ -8557,7 +8557,7 @@ bool handSetState(s32 handnum, s32 state) struct hand *hand = &g_Vars.currentplayer->hands[handnum]; // Sanity check - don't allow changing function if there is no other - if (state == HANDSTATE_CHANGEFUNC && weaponGetFunction(&hand->base, 1 - hand->base.weaponfunc) == NULL) { + if (state == HANDSTATE_CHANGEFUNC && weaponGetFunction(&hand->gset, 1 - hand->gset.weaponfunc) == NULL) { valid = false; } @@ -8713,8 +8713,8 @@ void currentPlayerDecreaseNoiseRadius(void) { struct player *player = g_Vars.currentplayer; f32 consideramount; - struct shorthand shortleft; - struct shorthand shortright; + struct gset shortleft; + struct gset shortright; f32 sp3c[5]; f32 sp28[5]; f32 subamount; @@ -10514,7 +10514,7 @@ glabel func0f09e4e0 .L0f09e818: /* f09e818: 02802025 */ or $a0,$s4,$zero /* f09e81c: 00008825 */ or $s1,$zero,$zero -/* f09e820: 0fc2c40f */ jal handGetWeaponFunction2 +/* f09e820: 0fc2c40f */ jal gsetGetWeaponFunction2 /* f09e824: 2415ffff */ addiu $s5,$zero,-1 /* f09e828: 00408025 */ or $s0,$v0,$zero /* f09e82c: 0fc2c3f4 */ jal weaponFindById @@ -10921,7 +10921,7 @@ glabel func0f09e4e0 .NB0f09c6c4: /* f09c6c4: 02802025 */ or $a0,$s4,$zero /* f09c6c8: 00008825 */ or $s1,$zero,$zero -/* f09c6cc: 0fc2bb67 */ jal handGetWeaponFunction2 +/* f09c6cc: 0fc2bb67 */ jal gsetGetWeaponFunction2 /* f09c6d0: 2415ffff */ addiu $s5,$zero,-1 /* f09c6d4: 00408025 */ or $s0,$v0,$zero /* f09c6d8: 0fc2bb4c */ jal weaponFindById @@ -11216,12 +11216,12 @@ void func0f09ed2c(struct defaultobj *obj, struct coord *newpos, Mtxf *arg2, f32 /** * Create a thrown projectile. */ -struct weaponobj *func0f09ee18(struct chrdata *chr, struct shorthand *hand, struct coord *pos, s16 *rooms, Mtxf *arg4, struct coord *arg5) +struct weaponobj *func0f09ee18(struct chrdata *chr, struct gset *gset, struct coord *pos, s16 *rooms, Mtxf *arg4, struct coord *arg5) { struct weaponobj *thing = NULL; struct weaponfunc *basefunc; struct weaponfunc_throw *func; - struct weapon *weapon = weaponFindById(hand->weaponnum); + struct weapon *weapon = weaponFindById(gset->weaponnum); struct weaponobj *tmpthing; s32 playernum; f32 mf[4][4]; @@ -11231,28 +11231,28 @@ struct weaponobj *func0f09ee18(struct chrdata *chr, struct shorthand *hand, stru return false; } - basefunc = weapon->functions[hand->weaponfunc]; + basefunc = weapon->functions[gset->weaponfunc]; func = (struct weaponfunc_throw *) basefunc; if (func == NULL) { return false; } - if (hand->weaponnum == WEAPON_COMBATKNIFE) { + if (gset->weaponnum == WEAPON_COMBATKNIFE) { guRotateF(mf, 90.0f / (random() * (1.0f / U32_MAX) + 12.1f), arg4->m[1][0], arg4->m[1][1], arg4->m[1][2]); } else { func0f096360(mf); } - if (hand->weaponnum == WEAPON_LAPTOPGUN) { - tmpthing = func0f08b27c(func->projectilemodelnum, hand, chr); + if (gset->weaponnum == WEAPON_LAPTOPGUN) { + tmpthing = func0f08b27c(func->projectilemodelnum, gset, chr); if (tmpthing != NULL) { thing = tmpthing; } } else { - tmpthing = func0f08b658(func->projectilemodelnum, hand, chr); + tmpthing = func0f08b658(func->projectilemodelnum, gset, chr); if (tmpthing != NULL) { thing = tmpthing; @@ -11482,7 +11482,7 @@ glabel var7f1ac72c /* f09f34c: 100000a9 */ b .L0f09f5f4 /* f09f350: e7a8023c */ swc1 $f8,0x23c($sp) .L0f09f354: -/* f09f354: 0fc2c7aa */ jal handHasFunctionFlags +/* f09f354: 0fc2c7aa */ jal gsetHasFunctionFlags /* f09f358: 3c050080 */ lui $a1,0x80 /* f09f35c: 10400087 */ beqz $v0,.L0f09f57c /* f09f360: 3c017f1b */ lui $at,%hi(var7f1ac714) @@ -11998,7 +11998,7 @@ glabel var7f1ac72c /* f09f34c: 100000a9 */ b .L0f09f5f4 /* f09f350: e7a8023c */ swc1 $f8,0x23c($sp) .L0f09f354: -/* f09f354: 0fc2c7aa */ jal handHasFunctionFlags +/* f09f354: 0fc2c7aa */ jal gsetHasFunctionFlags /* f09f358: 3c050080 */ lui $a1,0x80 /* f09f35c: 10400087 */ beqz $v0,.L0f09f57c /* f09f360: 3c017f1b */ lui $at,%hi(var7f1ac714) @@ -12523,7 +12523,7 @@ glabel var7f1ac740 /* f09ff04: 00000000 */ nop /* f09ff08: 46803420 */ cvt.s.w $f16,$f6 /* f09ff0c: 46008282 */ mul.s $f10,$f16,$f0 -/* f09ff10: 0fc2c8e8 */ jal handHasFunctionFlags +/* f09ff10: 0fc2c8e8 */ jal gsetHasFunctionFlags /* f09ff14: e7aa025c */ swc1 $f10,0x25c($sp) /* f09ff18: 1040007a */ beqz $v0,.PF0f0a0104 /* f09ff1c: 00002025 */ move $a0,$zero @@ -13158,7 +13158,7 @@ glabel var7f1ac740 /* f09fc00: 00000000 */ nop /* f09fc04: 46803420 */ cvt.s.w $f16,$f6 /* f09fc08: 46008282 */ mul.s $f10,$f16,$f0 -/* f09fc0c: 0fc2c7aa */ jal handHasFunctionFlags +/* f09fc0c: 0fc2c7aa */ jal gsetHasFunctionFlags /* f09fc10: e7aa025c */ swc1 $f10,0x25c($sp) /* f09fc14: 1040007a */ beqz $v0,.L0f09fe00 /* f09fc18: 00002025 */ or $a0,$zero,$zero @@ -13784,7 +13784,7 @@ glabel var7f1ac740 /* f09da74: 00000000 */ sll $zero,$zero,0x0 /* f09da78: 46803420 */ cvt.s.w $f16,$f6 /* f09da7c: 46008282 */ mul.s $f10,$f16,$f0 -/* f09da80: 0fc2bf02 */ jal handHasFunctionFlags +/* f09da80: 0fc2bf02 */ jal gsetHasFunctionFlags /* f09da84: e7aa025c */ swc1 $f10,0x25c($sp) /* f09da88: 1040007a */ beqz $v0,.NB0f09dc74 /* f09da8c: 00002025 */ or $a0,$zero,$zero @@ -15803,11 +15803,11 @@ void func0f0a1528(void) player->hands[i].loadslide = 0.0f; player->hands[i].allowshootframe = 0; player->hands[i].lastshootframe60 = 0; - player->hands[i].base.weaponfunc = FUNC_PRIMARY; + player->hands[i].gset.weaponfunc = FUNC_PRIMARY; - player->hands[i].base.weaponnum = ctrl->weaponnum; + player->hands[i].gset.weaponnum = ctrl->weaponnum; - player->hands[i].base.unk0639 = (ctrl->upgradewant >> (i * 4)) & 0xf; + player->hands[i].gset.unk0639 = (ctrl->upgradewant >> (i * 4)) & 0xf; player->hands[i].ganstarot = 0.0f; func0f0abd30(i); @@ -16906,7 +16906,7 @@ bool func0f0a27c8(void) struct weaponfunc *func; hand = &g_Vars.currentplayer->hands[HAND_RIGHT]; - func = handGetWeaponFunction2(&hand->base); + func = gsetGetWeaponFunction2(&hand->gset); if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE @@ -16920,7 +16920,7 @@ bool func0f0a27c8(void) hand = &g_Vars.currentplayer->hands[HAND_LEFT]; if (hand->inuse) { - func = handGetWeaponFunction2(&hand->base); + func = gsetGetWeaponFunction2(&hand->gset); if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE @@ -16946,7 +16946,7 @@ bool func0f0a28d8(void) struct weaponfunc *func; hand = &g_Vars.currentplayer->hands[HAND_RIGHT]; - func = handGetWeaponFunction2(&hand->base); + func = gsetGetWeaponFunction2(&hand->gset); if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE @@ -16959,7 +16959,7 @@ bool func0f0a28d8(void) hand = &g_Vars.currentplayer->hands[HAND_LEFT]; if (hand->inuse) { - func = handGetWeaponFunction2(&hand->base); + func = gsetGetWeaponFunction2(&hand->gset); if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE @@ -17019,7 +17019,7 @@ bool weaponIsMissionCritical(s32 weaponnum) void currentPlayerLoseGun(struct prop *attackerprop) { struct player *player = g_Vars.currentplayer; - s32 weaponnum = player->hands[0].base.weaponnum; + s32 weaponnum = player->hands[0].gset.weaponnum; struct chrdata *chr; s32 modelnum; s32 i; @@ -17057,13 +17057,13 @@ void currentPlayerLoseGun(struct prop *attackerprop) // Or drop it at player's feet with the pin pulled maybe... if (weaponnum == WEAPON_GRENADE || weaponnum == WEAPON_NBOMB) { for (i = 0; i < 2; i++) { - struct weaponfunc *func = handGetWeaponFunction(&player->hands[i].base); + struct weaponfunc *func = gsetGetWeaponFunction(&player->hands[i].gset); if ((func->type & 0xff) == INVENTORYFUNCTYPE_THROW && player->hands[i].state == HANDSTATE_ATTACK && player->hands[i].stateminor == 0) { drop = false; - handCreateThrownProjectile(i + 2, &player->hands[i].base); + handCreateThrownProjectile(i + 2, &player->hands[i].gset); } } } @@ -17404,7 +17404,7 @@ void playerDetonateRemoteMines(s32 playernum) s32 prevplayernum = g_Vars.currentplayernum; setCurrentPlayerNum(playernum); - if (g_Vars.currentplayer->hands[HAND_LEFT].base.weaponnum == WEAPON_REMOTEMINE) { + if (g_Vars.currentplayer->hands[HAND_LEFT].gset.weaponnum == WEAPON_REMOTEMINE) { func0f0988e0(var80070200, 1, &g_Vars.currentplayer->hands[HAND_LEFT]); } @@ -19837,7 +19837,7 @@ glabel var7f1ac8c4 void func0f0a4334(struct hand *hand) { - if (hand->firing && hand->base.weaponfunc == FUNC_SECONDARY) { + if (hand->firing && hand->gset.weaponfunc == FUNC_SECONDARY) { if (hand->audiohandle == NULL && g_Vars.lvupdate240 != 0) { sndStart(var80095200, SFX_LASER_STREAM, &hand->audiohandle, -1, -1, -1, -1, -1); } @@ -21920,7 +21920,7 @@ glabel var7f1add20pf /* f0a593c: 00000000 */ nop /* f0a5940: afaf01c0 */ sw $t7,0x1c0($sp) .PF0f0a5944: -/* f0a5944: 0fc2c53f */ jal handGetWeaponFunction2 +/* f0a5944: 0fc2c53f */ jal gsetGetWeaponFunction2 /* f0a5948: 02002025 */ move $a0,$s0 /* f0a594c: 10400007 */ beqz $v0,.PF0f0a596c /* f0a5950: afa201d8 */ sw $v0,0x1d8($sp) @@ -23459,7 +23459,7 @@ glabel var7f1aca70 /* f0a5624: 00000000 */ nop /* f0a5628: afaf01b8 */ sw $t7,0x1b8($sp) .L0f0a562c: -/* f0a562c: 0fc2c40f */ jal handGetWeaponFunction2 +/* f0a562c: 0fc2c40f */ jal gsetGetWeaponFunction2 /* f0a5630: 02002025 */ or $a0,$s0,$zero /* f0a5634: 10400007 */ beqz $v0,.L0f0a5654 /* f0a5638: afa201d0 */ sw $v0,0x1d0($sp) @@ -24794,7 +24794,7 @@ void handsTickMaulerCharge(void) if (handIsReloading(hand)) { // Reloading - reset charge amount hand->matmot1 = 0; - } else if (hand->base.weaponfunc == FUNC_SECONDARY) { + } else if (hand->gset.weaponfunc == FUNC_SECONDARY) { // Charging or fully charged s32 oldvalue = hand->matmot1; s32 newvalue; @@ -24901,7 +24901,7 @@ void func0f0a6c30(void) player->epcol_2 = 1; } else { if (player->gunsightoff == 0) { - if (player->hands[HAND_RIGHT].base.weaponnum == WEAPON_FARSIGHT) { + if (player->hands[HAND_RIGHT].gset.weaponnum == WEAPON_FARSIGHT) { // Aiming with the Farsight if (player->visionmode != VISIONMODE_XRAY) { player->erasertime = 0; @@ -27645,7 +27645,7 @@ struct audiohandle **func0f0a7d5c(void) #if VERSION >= VERSION_NTSC_1_0 GLOBAL_ASM( -glabel handPlayPropHitSound +glabel gsetPlayPropHitSound .late_rodata glabel var7f1aca94 .word 0x453b8000 @@ -28093,7 +28093,7 @@ glabel var7f1aca94 ); #else GLOBAL_ASM( -glabel handPlayPropHitSound +glabel gsetPlayPropHitSound .late_rodata glabel var7f1aca94 .word 0x453b8000 @@ -30264,7 +30264,7 @@ void handsTick(bool triggeron) struct hand *lhand = &g_Vars.currentplayer->hands[HAND_LEFT]; struct hand *rhand = &g_Vars.currentplayer->hands[HAND_RIGHT]; - weapon = weaponFindById(rhand->base.weaponnum); + weapon = weaponFindById(rhand->gset.weaponnum); for (i = 0; i != 2; i++) { if (weapon && weapon->ammos[i] && @@ -30470,7 +30470,7 @@ s32 currentPlayerGetAmmoCountWithCheck(s32 ammotype) for (i = 0; i < 2; i++) { if (player->hands[i].inuse) { for (j = 0; j < 2; j++) { - if (player->gunctrl.ammotypes[j] == ammotype && func0f0b184c(player->hands[i].base.weaponnum, j, 0x00000001)) { + if (player->gunctrl.ammotypes[j] == ammotype && func0f0b184c(player->hands[i].gset.weaponnum, j, 0x00000001)) { total = total + player->hands[i].loadedammo[j]; } } @@ -36366,7 +36366,7 @@ const char var7f1ac19c[] = "%02d:%02d\n"; // // // a9c // fncolour = 0xff000040; -// funcnum = hand->base.weaponfunc; +// funcnum = hand->gset.weaponfunc; // fnfaderinc = PALUP(g_Vars.lvupdate240 * 2); // //#if VERSION >= VERSION_NTSC_1_0 @@ -36423,9 +36423,9 @@ const char var7f1ac19c[] = "%02d:%02d\n"; // // Render weapon name and function name // if (optionsGetShowGunFunction(g_Vars.currentplayerstats->mpindex)) { //#if VERSION >= VERSION_NTSC_1_0 -// func = weaponGetFunctionById(hand->base.weaponnum, funcnum); +// func = weaponGetFunctionById(hand->gset.weaponnum, funcnum); //#else -// func = weaponGetFunctionById(hand->base.weaponnum, hand->base.weaponfunc); +// func = weaponGetFunctionById(hand->gset.weaponnum, hand->gset.weaponfunc); //#endif // nameid = invGetNameIdByIndex(invGetCurrentIndex()); // str = langGet(nameid); @@ -36513,11 +36513,11 @@ const char var7f1ac19c[] = "%02d:%02d\n"; // colour |= 0x00ff0000; // } //#else -// if (hand->base.weaponfunc == FUNC_SECONDARY && func->name == ctrl->curfnstr) { +// if (hand->gset.weaponfunc == FUNC_SECONDARY && func->name == ctrl->curfnstr) { // colour |= 0x00ff0000; // } // -// if (hand->base.weaponfunc == FUNC_PRIMARY && func->name != ctrl->curfnstr) { +// if (hand->gset.weaponfunc == FUNC_PRIMARY && func->name != ctrl->curfnstr) { // colour |= 0x00ff0000; // } //#endif @@ -36557,13 +36557,13 @@ const char var7f1ac19c[] = "%02d:%02d\n"; // } // // // 2b8 -// if (weapon && weapon->functions[hand->base.weaponfunc] != NULL) { -// ammoindex = ((struct weaponfunc *)(weapon->functions[hand->base.weaponfunc]))->ammoindex; +// if (weapon && weapon->functions[hand->gset.weaponfunc] != NULL) { +// ammoindex = ((struct weaponfunc *)(weapon->functions[hand->gset.weaponfunc]))->ammoindex; // } // // if (ammoindex == -1) { -// if (weapon->functions[1 - hand->base.weaponfunc] != NULL) { -// ammoindex = ((struct weaponfunc *)(weapon->functions[1 - hand->base.weaponfunc]))->ammoindex; +// if (weapon->functions[1 - hand->gset.weaponfunc] != NULL) { +// ammoindex = ((struct weaponfunc *)(weapon->functions[1 - hand->gset.weaponfunc]))->ammoindex; // } // // if (ammoindex == -1) { @@ -36584,7 +36584,7 @@ const char var7f1ac19c[] = "%02d:%02d\n"; // // Left hand - mag // if (lefthand->inuse // && weapon->ammos[ammoindex] != NULL -// && lefthand->base.weaponnum != WEAPON_REMOTEMINE) { +// && lefthand->gset.weaponnum != WEAPON_REMOTEMINE) { // xpos = viGetViewLeft() / g_ScaleX + 24; // // if (playercount == 2 && (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || IS4MB()) && playernum == 1) { @@ -36662,7 +36662,7 @@ const char var7f1ac19c[] = "%02d:%02d\n"; // // // 8b8 // // Combat boost timer -// if (hand->base.weaponnum == WEAPON_COMBATBOOST) { +// if (hand->gset.weaponnum == WEAPON_COMBATBOOST) { // mins = g_Vars.speedpilltime / 3600; // // // 91c @@ -36774,7 +36774,7 @@ void func0f0abd30(s32 handnum) struct player *player = g_Vars.currentplayer; struct hand *hand = &player->hands[handnum]; struct gunctrl *gunctrl = &player->gunctrl; - struct weapon *weapon = weaponFindById(hand->base.weaponnum); + struct weapon *weapon = weaponFindById(hand->gset.weaponnum); s32 i; for (i = 0; i < 2; i++) { @@ -36789,7 +36789,7 @@ void func0f0abd30(s32 handnum) hand->clipsizes[i] = weapon->ammos[i]->clipsize; - if (handnum == HAND_LEFT && hand->base.weaponnum == WEAPON_REMOTEMINE) { + if (handnum == HAND_LEFT && hand->gset.weaponnum == WEAPON_REMOTEMINE) { hand->clipsizes[i] = 0; } diff --git a/src/game/game_0abe70.c b/src/game/game_0abe70.c index a7d20e4a9..afc603059 100644 --- a/src/game/game_0abe70.c +++ b/src/game/game_0abe70.c @@ -2319,7 +2319,7 @@ glabel var7f1acd60 /* f0ade58: afa200c4 */ sw $v0,0xc4($sp) /* f0ade5c: afaf00c0 */ sw $t7,0xc0($sp) /* f0ade60: 24640638 */ addiu $a0,$v1,0x638 -/* f0ade64: 0fc2c40f */ jal handGetWeaponFunction2 +/* f0ade64: 0fc2c40f */ jal gsetGetWeaponFunction2 /* f0ade68: afa30030 */ sw $v1,0x30($sp) /* f0ade6c: 8faa0134 */ lw $t2,0x134($sp) /* f0ade70: 81441580 */ lb $a0,0x1580($t2) @@ -3150,7 +3150,7 @@ glabel var7f1acd60 /* f0ade58: afa200c4 */ sw $v0,0xc4($sp) /* f0ade5c: afaf00c0 */ sw $t7,0xc0($sp) /* f0ade60: 24640638 */ addiu $a0,$v1,0x638 -/* f0ade64: 0fc2c40f */ jal handGetWeaponFunction2 +/* f0ade64: 0fc2c40f */ jal gsetGetWeaponFunction2 /* f0ade68: afa30030 */ sw $v1,0x30($sp) /* f0ade6c: 8faa0134 */ lw $t2,0x134($sp) /* f0ade70: 81441580 */ lb $a0,0x1580($t2) diff --git a/src/game/game_0b0fd0.c b/src/game/game_0b0fd0.c index e2fa3fff1..296432477 100644 --- a/src/game/game_0b0fd0.c +++ b/src/game/game_0b0fd0.c @@ -40,31 +40,31 @@ struct weaponfunc *weaponGetFunctionById(u32 weaponnum, u32 which) return NULL; } -struct weaponfunc *handGetWeaponFunction2(struct shorthand *hand) +struct weaponfunc *gsetGetWeaponFunction2(struct gset *gset) { - struct weapon *weapon = weaponFindById(hand->weaponnum); + struct weapon *weapon = weaponFindById(gset->weaponnum); if (weapon) { - return weapon->functions[hand->weaponfunc]; + return weapon->functions[gset->weaponfunc]; } return NULL; } -struct weaponfunc *handGetWeaponFunction(struct shorthand *hand) +struct weaponfunc *gsetGetWeaponFunction(struct gset *gset) { - struct weapon *weapon = g_Weapons[hand->weaponnum]; + struct weapon *weapon = g_Weapons[gset->weaponnum]; if (weapon) { - return weapon->functions[hand->weaponfunc]; + return weapon->functions[gset->weaponfunc]; } return NULL; } -struct weaponfunc *weaponGetFunction(struct shorthand *hand, s32 which) +struct weaponfunc *weaponGetFunction(struct gset *gset, s32 which) { - struct weapon *weapon = g_Weapons[hand->weaponnum]; + struct weapon *weapon = g_Weapons[gset->weaponnum]; if (weapon) { return weapon->functions[which]; @@ -75,10 +75,10 @@ struct weaponfunc *weaponGetFunction(struct shorthand *hand, s32 which) struct weaponfunc *currentPlayerGetWeaponFunction(u32 hand) { - struct weapon *weapon = weaponFindById(g_Vars.currentplayer->hands[hand].base.weaponnum); + struct weapon *weapon = weaponFindById(g_Vars.currentplayer->hands[hand].gset.weaponnum); if (weapon) { - return weapon->functions[g_Vars.currentplayer->hands[hand].base.weaponfunc]; + return weapon->functions[g_Vars.currentplayer->hands[hand].gset.weaponfunc]; } return NULL; @@ -102,9 +102,9 @@ u32 weaponGetNumFunctions(u32 weaponnum) return 2; } -struct inventory_class *func0f0b11bc(struct shorthand *hand) +struct inventory_class *func0f0b11bc(struct gset *gset) { - struct weapon *weapon = weaponFindById(hand->weaponnum); + struct weapon *weapon = weaponFindById(gset->weaponnum); if (weapon) { return weapon->eptr; @@ -496,26 +496,26 @@ glabel handPopulateFromCurrentPlayer ); // Mismatch: regalloc -//void handPopulateFromCurrentPlayer(s32 handnum, struct shorthand *hand) +//void handPopulateFromCurrentPlayer(s32 handnum, struct gset *gset) //{ -// hand->weaponnum = g_Vars.currentplayer->weaponnum; -// hand->weaponfunc = g_Vars.currentplayer->hands[handnum].weaponfunc; -// hand->unk063a = g_Vars.currentplayer->hands[handnum].unk063a; -// hand->unk0639 = g_Vars.currentplayer->hands[handnum].unk0639; +// gset->weaponnum = g_Vars.currentplayer->weaponnum; +// gset->weaponfunc = g_Vars.currentplayer->hands[handnum].weaponfunc; +// gset->unk063a = g_Vars.currentplayer->hands[handnum].unk063a; +// gset->unk0639 = g_Vars.currentplayer->hands[handnum].unk0639; // -// if (hand->weaponnum == WEAPON_MAULER) { -// hand->unk063a = g_Vars.currentplayer->hands[handnum].matmot1 * 10.0f; +// if (gset->weaponnum == WEAPON_MAULER) { +// gset->unk063a = g_Vars.currentplayer->hands[handnum].matmot1 * 10.0f; // } // -// if (hand->weaponnum == WEAPON_LASER) { -// hand->unk063a = g_Vars.currentplayer->hands[handnum].burstbullets; +// if (gset->weaponnum == WEAPON_LASER) { +// gset->unk063a = g_Vars.currentplayer->hands[handnum].burstbullets; // } //} -struct inventory_ammo *handGetAmmoDefinition(struct shorthand *hand) +struct inventory_ammo *gsetGetAmmoDefinition(struct gset *gset) { - struct weaponfunc *func = handGetWeaponFunction(hand); - struct weapon *weapon = weaponFindById(hand->weaponnum); + struct weaponfunc *func = gsetGetWeaponFunction(gset); + struct weapon *weapon = weaponFindById(gset->weaponnum); if (func && func->ammoindex >= 0) { return weapon->ammos[func->ammoindex]; @@ -524,9 +524,9 @@ struct inventory_ammo *handGetAmmoDefinition(struct shorthand *hand) return NULL; } -u8 handGetSingleUnk3c(struct shorthand *hand) +u8 gsetGetSingleUnk3c(struct gset *gset) { - struct weaponfunc *func = handGetWeaponFunction(hand); + struct weaponfunc *func = gsetGetWeaponFunction(gset); if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_SHOOT) { struct weaponfunc_shoot *funcshoot = (struct weaponfunc_shoot *)func; @@ -536,10 +536,10 @@ u8 handGetSingleUnk3c(struct shorthand *hand) return 0; } -u32 handGetCasingEject(struct shorthand *hand) +u32 handGetCasingEject(struct gset *gset) { u32 result = 0; - struct inventory_ammo *ammo = handGetAmmoDefinition(hand); + struct inventory_ammo *ammo = gsetGetAmmoDefinition(gset); if (ammo) { result = ammo->casingeject; @@ -548,9 +548,9 @@ u32 handGetCasingEject(struct shorthand *hand) return result; } -f32 handGetStrength(struct shorthand *hand) +f32 gsetGetStrength(struct gset *gset) { - struct weaponfunc *func = handGetWeaponFunction(hand); + struct weaponfunc *func = gsetGetWeaponFunction(gset); f32 result = 0; if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_SHOOT) { @@ -561,9 +561,9 @@ f32 handGetStrength(struct shorthand *hand) return result; } -f32 handGetDamage(struct shorthand *hand) +f32 gsetGetDamage(struct gset *gset) { - struct weaponfunc *func = handGetWeaponFunction(hand); + struct weaponfunc *func = gsetGetWeaponFunction(gset); f32 damage = 0; if (func) { @@ -576,7 +576,7 @@ f32 handGetDamage(struct shorthand *hand) struct weaponfunc_close *fullfunc = (struct weaponfunc_close *)func; damage = fullfunc->damage; - if (hand->weaponnum == WEAPON_REAPER) { + if (gset->weaponnum == WEAPON_REAPER) { #if VERSION >= VERSION_PAL_FINAL damage *= g_Vars.lvupdate240freal; #else @@ -591,8 +591,8 @@ f32 handGetDamage(struct shorthand *hand) } } - if (hand->weaponnum == WEAPON_MAULER) { - damage = (hand->unk063a / 3.0f + 1.0f) * damage; + if (gset->weaponnum == WEAPON_MAULER) { + damage = (gset->unk063a / 3.0f + 1.0f) * damage; } if (handIsFiring(HAND_LEFT) && handIsFiring(HAND_RIGHT)) { @@ -602,10 +602,10 @@ f32 handGetDamage(struct shorthand *hand) return damage; } -u8 handGetSingleUnk38(struct shorthand *hand) +u8 gsetGetSingleUnk38(struct gset *gset) { #if VERSION >= VERSION_PAL_FINAL - struct weaponfunc *func = handGetWeaponFunction(hand); + struct weaponfunc *func = gsetGetWeaponFunction(gset); u8 result = 0; if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_SHOOT) { @@ -619,7 +619,7 @@ u8 handGetSingleUnk38(struct shorthand *hand) return result; #else - struct weaponfunc *func = handGetWeaponFunction(hand); + struct weaponfunc *func = gsetGetWeaponFunction(gset); if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_SHOOT) { struct weaponfunc_shoot *funcshoot = (struct weaponfunc_shoot *)func; @@ -630,9 +630,9 @@ u8 handGetSingleUnk38(struct shorthand *hand) #endif } -u16 handGetSingleShootSound(struct shorthand *hand) +u16 gsetGetSingleShootSound(struct gset *gset) { - struct weaponfunc *func = handGetWeaponFunction(hand); + struct weaponfunc *func = gsetGetWeaponFunction(gset); if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_SHOOT) { struct weaponfunc_shoot *funcshoot = (struct weaponfunc_shoot *)func; @@ -642,9 +642,9 @@ u16 handGetSingleShootSound(struct shorthand *hand) return 0; } -bool handHasFunctionFlags(struct shorthand *hand, u32 flags) +bool gsetHasFunctionFlags(struct gset *gset, u32 flags) { - struct weaponfunc *func = handGetWeaponFunction(hand); + struct weaponfunc *func = gsetGetWeaponFunction(gset); if (func) { return (func->flags & flags) == flags; @@ -676,8 +676,8 @@ s8 weaponGetNumTicksPerShot(u32 weaponnum, u32 funcindex) u32 currentPlayerGetSight(void) { struct weaponfunc *func = weaponGetFunctionById( - g_Vars.currentplayer->hands[HAND_RIGHT].base.weaponnum, - g_Vars.currentplayer->hands[HAND_RIGHT].base.weaponfunc); + g_Vars.currentplayer->hands[HAND_RIGHT].gset.weaponnum, + g_Vars.currentplayer->hands[HAND_RIGHT].gset.weaponfunc); if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) { return SIGHT_NONE; @@ -687,7 +687,7 @@ u32 currentPlayerGetSight(void) return SIGHT_CLASSIC; } - switch (g_Vars.currentplayer->hands[HAND_RIGHT].base.weaponnum) { + switch (g_Vars.currentplayer->hands[HAND_RIGHT].gset.weaponnum) { case WEAPON_HORIZONSCANNER: return SIGHT_NONE; case WEAPON_NONE: @@ -749,7 +749,7 @@ glabel func0f0b201c /* f0b201c: 27bdffe0 */ addiu $sp,$sp,-32 /* f0b2020: afbf0014 */ sw $ra,0x14($sp) /* f0b2024: afa0001c */ sw $zero,0x1c($sp) -/* f0b2028: 0fc2c41f */ jal handGetWeaponFunction +/* f0b2028: 0fc2c41f */ jal gsetGetWeaponFunction /* f0b202c: afa50024 */ sw $a1,0x24($sp) /* f0b2030: 8fa3001c */ lw $v1,0x1c($sp) /* f0b2034: 10400002 */ beqz $v0,.L0f0b2040 @@ -777,9 +777,9 @@ glabel func0f0b201c /* f0b2084: 00000000 */ nop ); -struct guncmd *handGetEquipAnim(struct shorthand *hand) +struct guncmd *handGetEquipAnim(struct gset *gset) { - struct weapon *weapon = g_Weapons[hand->weaponnum]; + struct weapon *weapon = g_Weapons[gset->weaponnum]; if (weapon) { return weapon->equip_animation; @@ -788,9 +788,9 @@ struct guncmd *handGetEquipAnim(struct shorthand *hand) return NULL; } -struct guncmd *handGetUnequipAnim(struct shorthand *hand) +struct guncmd *handGetUnequipAnim(struct gset *gset) { - struct weapon *weapon = g_Weapons[hand->weaponnum]; + struct weapon *weapon = g_Weapons[gset->weaponnum]; if (weapon) { return weapon->unequip_animation; @@ -799,9 +799,9 @@ struct guncmd *handGetUnequipAnim(struct shorthand *hand) return NULL; } -struct guncmd *handGetPriToSecAnim(struct shorthand *hand) +struct guncmd *gsetGetPriToSecAnim(struct gset *gset) { - struct weapon *weapon = g_Weapons[hand->weaponnum]; + struct weapon *weapon = g_Weapons[gset->weaponnum]; if (weapon) { return weapon->pritosec_animation; @@ -810,9 +810,9 @@ struct guncmd *handGetPriToSecAnim(struct shorthand *hand) return NULL; } -struct guncmd *handGetSecToPriAnim(struct shorthand *hand) +struct guncmd *gsetGetSecToPriAnim(struct gset *gset) { - struct weapon *weapon = g_Weapons[hand->weaponnum]; + struct weapon *weapon = g_Weapons[gset->weaponnum]; if (weapon) { return weapon->sectopri_animation; diff --git a/src/game/game_190260.c b/src/game/game_190260.c index 6f18d54e7..d69d37ae3 100644 --- a/src/game/game_190260.c +++ b/src/game/game_190260.c @@ -2625,7 +2625,7 @@ s32 mpchrGetWeaponNum(struct chrdata *chr) return chr->aibot->weaponnum; } - return g_Vars.players[propGetPlayerNum(chr->prop)]->hands[HAND_RIGHT].base.weaponnum; + return g_Vars.players[propGetPlayerNum(chr->prop)]->hands[HAND_RIGHT].gset.weaponnum; } u8 mpchrGetTargetsWeaponNum(struct chrdata *chr) diff --git a/src/game/game_1999b0.c b/src/game/game_1999b0.c index 284f93241..b99d09ef9 100644 --- a/src/game/game_1999b0.c +++ b/src/game/game_1999b0.c @@ -238,8 +238,8 @@ bool aibotDoFarsightThing(struct chrdata *chr, u32 arg1, struct coord *vector, s struct model *model = NULL; s32 side = -1; s32 hitpart = HITPART_GENERAL; - struct shorthand hand = {WEAPON_FARSIGHT, 0, 0, FUNC_PRIMARY}; - f32 damage = handGetDamage(&hand); + struct gset gset = {WEAPON_FARSIGHT, 0, 0, FUNC_PRIMARY}; + f32 damage = gsetGetDamage(&gset); s32 fallback = 30; s32 value = fallback; @@ -267,14 +267,14 @@ bool aibotDoFarsightThing(struct chrdata *chr, u32 arg1, struct coord *vector, s if (oppchr != chr && value > rand && func0f06b39c(arg3, vector, &oppprop->pos, func0f0278a4(oppchr))) { - handPlayPropHitSound(&hand, oppprop, -1); + gsetPlayPropHitSound(&gset, oppprop, -1); if (oppchr->model && chrGetShield(oppchr) > 0) { chrCalculateShieldHit(oppchr, &oppprop->pos, vector, &node, &hitpart, &model, &side); } chrEmitSparks(oppchr, oppprop, hitpart, &oppprop->pos, vector, chr); - func0f0341dc(oppchr, damage, vector, &hand, chr->prop, HITPART_GENERAL, oppprop, node, model, side, 0); + func0f0341dc(oppchr, damage, vector, &gset, chr->prop, HITPART_GENERAL, oppprop, node, model, side, 0); } } @@ -352,13 +352,13 @@ void func0f19a37c(struct chrdata *chr) Mtxf sp84; f32 sp80 = chrGetAimAngle(chr); u32 stack; - struct shorthand hand = {0}; + struct gset gset = {0}; struct prop *target = chrGetTargetProp(chr); struct coord sp56; f32 mult; - hand.weaponnum = chr->aibot->weaponnum; - hand.weaponfunc = chr->aibot->gunfunc; + gset.weaponnum = chr->aibot->weaponnum; + gset.weaponfunc = chr->aibot->gunfunc; if (chrIsTargetInFov(chr, WEAPON_GRENADE, 0)) { sp56.x = target->pos.x; @@ -403,9 +403,9 @@ void func0f19a37c(struct chrdata *chr) func00016374(sp80, &sp84); func00015be0(&sp84, &sp164); - func0f09ee18(chr, &hand, &prop->pos, prop->rooms, &sp164, &sp228); + func0f09ee18(chr, &gset, &prop->pos, prop->rooms, &sp164, &sp228); - if (hand.weaponnum == WEAPON_REMOTEMINE) { + if (gset.weaponnum == WEAPON_REMOTEMINE) { chr->aibot->unk064 |= 0x1000; } } diff --git a/src/game/lv.c b/src/game/lv.c index 14601feb6..96c07b3b3 100644 --- a/src/game/lv.c +++ b/src/game/lv.c @@ -2618,7 +2618,7 @@ glabel var7f1b8e7cpf .PF0f16af54: /* f16af54: 26040638 */ addiu $a0,$s0,0x638 .PF0f16af58: -/* f16af58: 0fc2c8e8 */ jal handHasFunctionFlags +/* f16af58: 0fc2c8e8 */ jal gsetHasFunctionFlags /* f16af5c: 3c050008 */ lui $a1,0x8 /* f16af60: 10400005 */ beqz $v0,.PF0f16af78 /* f16af64: 00000000 */ nop @@ -3929,7 +3929,7 @@ Gfx *lvRender(Gfx *gdl) g_Vars.currentplayer->lookingatprop.prop = NULL; } - if (handHasFunctionFlags(&g_Vars.currentplayer->hands[0].base, FUNCFLAG_THREATDETECTOR)) { + if (gsetHasFunctionFlags(&g_Vars.currentplayer->hands[0].gset, FUNCFLAG_THREATDETECTOR)) { lvFindThreats(); } else if (weaponHasFlag(handGetWeaponNum(HAND_RIGHT), WEAPONFLAG_AIMTRACK)) { s32 j; @@ -3976,12 +3976,12 @@ Gfx *lvRender(Gfx *gdl) } } else { // EYESPYMODE_BOMBSPY struct coord vel = {0, 0, 0}; - struct shorthand hand = {WEAPON_GRENADE, 0, 0, 0}; + struct gset gset = {WEAPON_GRENADE, 0, 0, FUNC_PRIMARY}; explosionCreateSimple(g_Vars.currentplayer->eyespy->prop, &g_Vars.currentplayer->eyespy->prop->pos, g_Vars.currentplayer->eyespy->prop->rooms, EXPLOSIONTYPE_23, 0); - chrBeginDeath(g_Vars.currentplayer->eyespy->prop->chr, &vel, 0, 0, &hand, false, 0); + chrBeginDeath(g_Vars.currentplayer->eyespy->prop->chr, &vel, 0, 0, &gset, false, 0); } } @@ -5206,7 +5206,7 @@ glabel var7f1b1fd4nb .NB0f164c64: /* f164c64: 26040638 */ addiu $a0,$s0,0x638 .NB0f164c68: -/* f164c68: 0fc2bf02 */ jal handHasFunctionFlags +/* f164c68: 0fc2bf02 */ jal gsetHasFunctionFlags /* f164c6c: 3c050008 */ lui $a1,0x8 /* f164c70: 10400005 */ beqz $v0,.NB0f164c88 /* f164c74: 00000000 */ sll $zero,$zero,0x0 diff --git a/src/game/mpstats.c b/src/game/mpstats.c index cfc72383e..486c0c3ea 100644 --- a/src/game/mpstats.c +++ b/src/game/mpstats.c @@ -18,23 +18,23 @@ u32 var80070590 = 0x00000000; -void mpstatsIncrementPlayerShotCount(struct shorthand *hand, s32 region) +void mpstatsIncrementPlayerShotCount(struct gset *gset, s32 region) { - if (!weaponHasFlag(hand->weaponnum, WEAPONFLAG_DONTCOUNTSHOTS)) { + if (!weaponHasFlag(gset->weaponnum, WEAPONFLAG_DONTCOUNTSHOTS)) { g_Vars.currentplayerstats->shotcount[region]++; } } -void mpstatsIncrementPlayerShotCount2(struct shorthand *hand, s32 region) +void mpstatsIncrementPlayerShotCount2(struct gset *gset, s32 region) { if (region == 0) { - if (!weaponHasFlag(hand->weaponnum, WEAPONFLAG_DONTCOUNTSHOTS)) { + if (!weaponHasFlag(gset->weaponnum, WEAPONFLAG_DONTCOUNTSHOTS)) { var80070590 = 1; g_Vars.currentplayerstats->shotcount[region]++; } } else { if (var80070590) { - if (!weaponHasFlag(hand->weaponnum, WEAPONFLAG_DONTCOUNTSHOTS)) { + if (!weaponHasFlag(gset->weaponnum, WEAPONFLAG_DONTCOUNTSHOTS)) { g_Vars.currentplayerstats->shotcount[region]++; } diff --git a/src/game/prop.c b/src/game/prop.c index 78bd2d8a2..b02a1d202 100644 --- a/src/game/prop.c +++ b/src/game/prop.c @@ -885,7 +885,7 @@ glabel var7f1a9eb8 /* f060e88: c4e80008 */ lwc1 $f8,0x8($a3) /* f060e8c: 0fc2c6bc */ jal handPopulateFromCurrentPlayer /* f060e90: e7a80210 */ swc1 $f8,0x210($sp) -/* f060e94: 0fc2c41f */ jal handGetWeaponFunction +/* f060e94: 0fc2c41f */ jal gsetGetWeaponFunction /* f060e98: 27a40214 */ addiu $a0,$sp,0x214 /* f060e9c: 10400013 */ beqz $v0,.L0f060eec /* f060ea0: afa201f0 */ sw $v0,0x1f0($sp) @@ -924,7 +924,7 @@ glabel var7f1a9eb8 .L0f060f18: /* f060f18: 53000006 */ beqzl $t8,.L0f060f34 /* f060f1c: 24190001 */ addiu $t9,$zero,0x1 -/* f060f20: 0fc2c71e */ jal handGetSingleUnk3c +/* f060f20: 0fc2c71e */ jal gsetGetSingleUnk3c /* f060f24: 27a40214 */ addiu $a0,$sp,0x214 /* f060f28: 10000003 */ b .L0f060f38 /* f060f2c: afa20234 */ sw $v0,0x234($sp) @@ -2267,7 +2267,7 @@ glabel func0f061fa8 /* f06226c: 00000000 */ nop ); -void handInflictCloseRangeDamage(s32 handnum, struct shorthand *hand, bool arg2) +void handInflictCloseRangeDamage(s32 handnum, struct gset *gset, bool arg2) { s32 someval; struct prop **ptr; @@ -2312,7 +2312,7 @@ void handInflictCloseRangeDamage(s32 handnum, struct shorthand *hand, bool arg2) struct defaultobj *obj = prop->obj; bool isbreakableobj = false; - if (obj && hand->weaponnum != WEAPON_TRANQUILIZER) { + if (obj && gset->weaponnum != WEAPON_TRANQUILIZER) { isbreakableobj = obj->type == OBJTYPE_GLASS || obj->type == OBJTYPE_TINTEDGLASS; } @@ -2332,7 +2332,7 @@ void handInflictCloseRangeDamage(s32 handnum, struct shorthand *hand, bool arg2) f32 spfc[2]; f32 spf4[2]; struct model *model; - struct weaponfunc *func = handGetWeaponFunction(hand); + struct weaponfunc *func = gsetGetWeaponFunction(gset); if ((func->type & 0xff) == 3) { struct weaponfunc_close *closefunc = (struct weaponfunc_close *)func; @@ -2371,10 +2371,10 @@ void handInflictCloseRangeDamage(s32 handnum, struct shorthand *hand, bool arg2) handCalculateShotSpread(&spd8, &spcc, handnum, true); if (func000225d4(model, &spd8, &spcc, &node) > 0) { - f32 damage = handGetDamage(hand) * 2.5f; + f32 damage = gsetGetDamage(gset) * 2.5f; skipthething = true; func0f0a8404(&playerprop->pos, playerprop->rooms, -1); - func0f085270(obj, damage, &prop->pos, hand->weaponnum, g_Vars.currentplayernum); + func0f085270(obj, damage, &prop->pos, gset->weaponnum, g_Vars.currentplayernum); func0f070698(prop, false); } } else if (arg2) { @@ -2391,7 +2391,7 @@ void handInflictCloseRangeDamage(s32 handnum, struct shorthand *hand, bool arg2) handCalculateShotSpread(&spb8, &vector, handnum, true); skipthething = true; func00015b10(currentPlayerGetUnk174c(), &vector); - handPlayPropHitSound(hand, prop, -1); + gsetPlayPropHitSound(gset, prop, -1); if (chr->model && chrGetShield(chr) > 0) { chrCalculateShieldHit(chr, &playerprop->pos, &vector, &node, &hitpart, &model, &side); @@ -2405,7 +2405,7 @@ void handInflictCloseRangeDamage(s32 handnum, struct shorthand *hand, bool arg2) hitpart = HITPART_TORSO; } - func0f0341dc(chr, handGetDamage(hand), &vector, hand, + func0f0341dc(chr, gsetGetDamage(gset), &vector, gset, g_Vars.currentplayer->prop, hitpart, chr->prop, node, model, side, 0); } } @@ -2450,7 +2450,7 @@ void handTickAttack(s32 handnum) g_Vars.currentplayer->hands[handnum].unk0d0f_03 = false; - handPopulateFromCurrentPlayer(handnum, (struct shorthand *)&tmpweaponnum); + handPopulateFromCurrentPlayer(handnum, (struct gset *)&tmpweaponnum); frIncrementNumShots(); switch (type) { @@ -2459,7 +2459,7 @@ void handTickAttack(s32 handnum) // right hand is not (ie. prevent firing both guns on the same tick) if (handnum == HAND_RIGHT || !handIsFiring(HAND_RIGHT)) { chrUncloakTemporarily(g_Vars.currentplayer->prop->chr); - mpstatsIncrementPlayerShotCount2((struct shorthand *)&tmpweaponnum, 0); + mpstatsIncrementPlayerShotCount2((struct gset *)&tmpweaponnum, 0); if (weaponnum == WEAPON_SHOTGUN) { handCreateBulletRaycast(handnum, true, true, 1, true); @@ -2477,10 +2477,10 @@ void handTickAttack(s32 handnum) break; case HANDATTACKTYPE_CLOSERANGE: chrUncloakTemporarily(g_Vars.currentplayer->prop->chr); - handInflictCloseRangeDamage(handnum, (struct shorthand *)&tmpweaponnum, false); + handInflictCloseRangeDamage(handnum, (struct gset *)&tmpweaponnum, false); break; case HANDATTACKTYPE_CLOSERANGENOUNCLOAK: - handInflictCloseRangeDamage(handnum, (struct shorthand *)&tmpweaponnum, true); + handInflictCloseRangeDamage(handnum, (struct gset *)&tmpweaponnum, true); break; case HANDATTACKTYPE_DETONATE: playerActivateRemoteMineDetonator(g_Vars.currentplayernum); @@ -2505,7 +2505,7 @@ void handTickAttack(s32 handnum) } break; case HANDATTACKTYPE_THROWPROJECTILE: - handCreateThrownProjectile(handnum, (struct shorthand *)&tmpweaponnum); + handCreateThrownProjectile(handnum, (struct gset *)&tmpweaponnum); break; case HANDATTACKTYPE_RCP120CLOAK: cloaked = (g_Vars.currentplayer->devicesactive & DEVICE_CLOAKRCP120) != 0; @@ -6520,7 +6520,7 @@ void autoaimTick(void) } if (handGetWeaponNum(HAND_RIGHT) == WEAPON_CMP150 - && g_Vars.currentplayer->hands[HAND_RIGHT].base.weaponfunc == FUNC_SECONDARY) { + && g_Vars.currentplayer->hands[HAND_RIGHT].gset.weaponfunc == FUNC_SECONDARY) { iscmpsec = true; } diff --git a/src/game/propobj.c b/src/game/propobj.c index dd325eb89..996d3f7bc 100644 --- a/src/game/propobj.c +++ b/src/game/propobj.c @@ -12279,7 +12279,7 @@ glabel func0f06f0a0 /* f06f240: 00000000 */ nop /* f06f244: 14e20012 */ bne $a3,$v0,.L0f06f290 /* f06f248: 2604005c */ addiu $a0,$s0,0x5c -/* f06f24c: 0fc29f66 */ jal handPlayPropHitSound +/* f06f24c: 0fc29f66 */ jal gsetPlayPropHitSound /* f06f250: 2406ffff */ addiu $a2,$zero,-1 /* f06f254: 9219005c */ lbu $t9,0x5c($s0) /* f06f258: 2401001a */ addiu $at,$zero,0x1a @@ -23312,7 +23312,7 @@ glabel var7f1ab6dcpf /* f075778: 24010035 */ li $at,0x35 /* f07577c: 10e10006 */ beq $a3,$at,.PF0f075798 /* f075780: 2624005c */ addiu $a0,$s1,0x5c -/* f075784: 0fc2c8e8 */ jal handHasFunctionFlags +/* f075784: 0fc2c8e8 */ jal gsetHasFunctionFlags /* f075788: 24050100 */ li $a1,0x100 /* f07578c: 50400014 */ beqzl $v0,.PF0f0757e0 /* f075790: 8fb801f8 */ lw $t8,0x1f8($sp) @@ -23512,7 +23512,7 @@ glabel var7f1ab6dcpf /* f075a4c: 0fc0d042 */ jal chrGetShield /* f075a50: afae01d4 */ sw $t6,0x1d4($sp) /* f075a54: 8fa40070 */ lw $a0,0x70($sp) -/* f075a58: 0fc2c87a */ jal handGetDamage +/* f075a58: 0fc2c87a */ jal gsetGetDamage /* f075a5c: e7a001d8 */ swc1 $f0,0x1d8($sp) /* f075a60: 3c188007 */ lui $t8,0x8007 /* f075a64: 3c098007 */ lui $t1,0x8007 @@ -26850,7 +26850,7 @@ glabel var7f1aa438 /* f0754f4: 24010035 */ addiu $at,$zero,0x35 /* f0754f8: 10e10006 */ beq $a3,$at,.L0f075514 /* f0754fc: 2624005c */ addiu $a0,$s1,0x5c -/* f075500: 0fc2c7aa */ jal handHasFunctionFlags +/* f075500: 0fc2c7aa */ jal gsetHasFunctionFlags /* f075504: 24050100 */ addiu $a1,$zero,0x100 /* f075508: 50400014 */ beqzl $v0,.L0f07555c /* f07550c: 8fb801f8 */ lw $t8,0x1f8($sp) @@ -27050,7 +27050,7 @@ glabel var7f1aa438 /* f0757c8: 0fc0cfe8 */ jal chrGetShield /* f0757cc: afae01d4 */ sw $t6,0x1d4($sp) /* f0757d0: 8fa40070 */ lw $a0,0x70($sp) -/* f0757d4: 0fc2c74a */ jal handGetDamage +/* f0757d4: 0fc2c74a */ jal gsetGetDamage /* f0757d8: e7a001d8 */ swc1 $f0,0x1d8($sp) /* f0757dc: 3c188007 */ lui $t8,%hi(var80069934) /* f0757e0: 3c098007 */ lui $t1,%hi(var80069930) @@ -30375,7 +30375,7 @@ glabel var7f1aa438 /* f074270: 24010035 */ addiu $at,$zero,0x35 /* f074274: 10e10006 */ beq $a3,$at,.NB0f074290 /* f074278: 2624005c */ addiu $a0,$s1,0x5c -/* f07427c: 0fc2bf02 */ jal handHasFunctionFlags +/* f07427c: 0fc2bf02 */ jal gsetHasFunctionFlags /* f074280: 24050100 */ addiu $a1,$zero,0x100 /* f074284: 50400014 */ beqzl $v0,.NB0f0742d8 /* f074288: 8faf01f8 */ lw $t7,0x1f8($sp) @@ -30552,7 +30552,7 @@ glabel var7f1aa438 /* f0744f4: 0fc0ce2a */ jal chrGetShield /* f0744f8: afae01d8 */ sw $t6,0x1d8($sp) /* f0744fc: 8fa40060 */ lw $a0,0x60($sp) -/* f074500: 0fc2bea2 */ jal handGetDamage +/* f074500: 0fc2bea2 */ jal gsetGetDamage /* f074504: e7a001dc */ swc1 $f0,0x1dc($sp) /* f074508: 3c188007 */ lui $t8,0x8007 /* f07450c: 3c0f8007 */ lui $t7,0x8007 @@ -37014,7 +37014,7 @@ glabel var7f1aa5a8 /* f07a368: afa000bc */ sw $zero,0xbc($sp) /* f07a36c: afb800b8 */ sw $t8,0xb8($sp) /* f07a370: afb900b4 */ sw $t9,0xb4($sp) -/* f07a374: 0fc2c74a */ jal handGetDamage +/* f07a374: 0fc2c74a */ jal gsetGetDamage /* f07a378: 27a40118 */ addiu $a0,$sp,0x118 /* f07a37c: 8fa80178 */ lw $t0,0x178($sp) /* f07a380: 3c09800a */ lui $t1,%hi(g_Vars+0x318) @@ -37054,7 +37054,7 @@ glabel var7f1aa5a8 /* f07a3fc: 51e00114 */ beqzl $t7,.L0f07a850 /* f07a400: 8fa40198 */ lw $a0,0x198($sp) .L0f07a404: -/* f07a404: 0fc29f66 */ jal handPlayPropHitSound +/* f07a404: 0fc29f66 */ jal gsetPlayPropHitSound /* f07a408: 2406ffff */ addiu $a2,$zero,-1 /* f07a40c: 8fa400ac */ lw $a0,0xac($sp) /* f07a410: 8c980020 */ lw $t8,0x20($a0) @@ -37182,7 +37182,7 @@ glabel var7f1aa5a8 /* f07a5dc: 27a400a0 */ addiu $a0,$sp,0xa0 .L0f07a5e0: /* f07a5e0: 8fa500a8 */ lw $a1,0xa8($sp) -/* f07a5e4: 0fc29f66 */ jal handPlayPropHitSound +/* f07a5e4: 0fc29f66 */ jal gsetPlayPropHitSound /* f07a5e8: 240600f2 */ addiu $a2,$zero,0xf2 /* f07a5ec: 10000098 */ b .L0f07a850 /* f07a5f0: 8fa40198 */ lw $a0,0x198($sp) @@ -37323,7 +37323,7 @@ glabel var7f1aa5a8 .L0f07a7f4: /* f07a7f4: 27a40118 */ addiu $a0,$sp,0x118 /* f07a7f8: 8fa50124 */ lw $a1,0x124($sp) -/* f07a7fc: 0fc29f66 */ jal handPlayPropHitSound +/* f07a7fc: 0fc29f66 */ jal gsetPlayPropHitSound /* f07a800: 2406ffff */ addiu $a2,$zero,-1 /* f07a804: 3c013f00 */ lui $at,0x3f00 /* f07a808: 44815000 */ mtc1 $at,$f10 @@ -37976,7 +37976,7 @@ glabel var7f1aa5a8 /* f07a368: afa000bc */ sw $zero,0xbc($sp) /* f07a36c: afb800b8 */ sw $t8,0xb8($sp) /* f07a370: afb900b4 */ sw $t9,0xb4($sp) -/* f07a374: 0fc2c74a */ jal handGetDamage +/* f07a374: 0fc2c74a */ jal gsetGetDamage /* f07a378: 27a40118 */ addiu $a0,$sp,0x118 /* f07a37c: 8fa80178 */ lw $t0,0x178($sp) /* f07a380: 3c09800a */ lui $t1,%hi(g_Vars+0x318) @@ -38016,7 +38016,7 @@ glabel var7f1aa5a8 /* f07a3fc: 51e00114 */ beqzl $t7,.L0f07a850 /* f07a400: 8fa40198 */ lw $a0,0x198($sp) .L0f07a404: -/* f07a404: 0fc29f66 */ jal handPlayPropHitSound +/* f07a404: 0fc29f66 */ jal gsetPlayPropHitSound /* f07a408: 2406ffff */ addiu $a2,$zero,-1 /* f07a40c: 8fa400ac */ lw $a0,0xac($sp) /* f07a410: 8c980020 */ lw $t8,0x20($a0) @@ -38144,7 +38144,7 @@ glabel var7f1aa5a8 /* f07a5dc: 27a400a0 */ addiu $a0,$sp,0xa0 .L0f07a5e0: /* f07a5e0: 8fa500a8 */ lw $a1,0xa8($sp) -/* f07a5e4: 0fc29f66 */ jal handPlayPropHitSound +/* f07a5e4: 0fc29f66 */ jal gsetPlayPropHitSound /* f07a5e8: 240600f2 */ addiu $a2,$zero,0xf2 /* f07a5ec: 10000098 */ b .L0f07a850 /* f07a5f0: 8fa40198 */ lw $a0,0x198($sp) @@ -38285,7 +38285,7 @@ glabel var7f1aa5a8 .L0f07a7f4: /* f07a7f4: 27a40118 */ addiu $a0,$sp,0x118 /* f07a7f8: 8fa50124 */ lw $a1,0x124($sp) -/* f07a7fc: 0fc29f66 */ jal handPlayPropHitSound +/* f07a7fc: 0fc29f66 */ jal gsetPlayPropHitSound /* f07a800: 2406ffff */ addiu $a2,$zero,-1 /* f07a804: 3c013f00 */ lui $at,0x3f00 /* f07a808: 44815000 */ mtc1 $at,$f10 @@ -59559,7 +59559,7 @@ glabel func0f085eac /* f085ec4: 80af004c */ lb $t7,0x4c($a1) /* f085ec8: 24840018 */ addiu $a0,$a0,0x18 /* f085ecc: afa40048 */ sw $a0,0x48($sp) -/* f085ed0: 0fc2c41f */ jal handGetWeaponFunction +/* f085ed0: 0fc2c41f */ jal gsetGetWeaponFunction /* f085ed4: afaf00fc */ sw $t7,0xfc($sp) /* f085ed8: 5040000e */ beqzl $v0,.L0f085f14 /* f085edc: 8fa40124 */ lw $a0,0x124($sp) @@ -59821,7 +59821,7 @@ glabel func0f085eac /* f08627c: 15600005 */ bnez $t3,.L0f086294 /* f086280: 8fa40048 */ lw $a0,0x48($sp) /* f086284: 8d050004 */ lw $a1,0x4($t0) -/* f086288: 0fc29f66 */ jal handPlayPropHitSound +/* f086288: 0fc29f66 */ jal gsetPlayPropHitSound /* f08628c: 8506003a */ lh $a2,0x3a($t0) /* f086290: 8fa80124 */ lw $t0,0x124($sp) .L0f086294: @@ -60066,7 +60066,7 @@ glabel func0f085eac /* f086604: 24012710 */ addiu $at,$zero,0x2710 /* f086608: 51a1005b */ beql $t5,$at,.L0f086778 /* f08660c: 8fa80124 */ lw $t0,0x124($sp) -/* f086610: 0fc2c74a */ jal handGetDamage +/* f086610: 0fc2c74a */ jal gsetGetDamage /* f086614: 8fa40048 */ lw $a0,0x48($sp) /* f086618: 8fac011c */ lw $t4,0x11c($sp) /* f08661c: 2401000d */ addiu $at,$zero,0xd @@ -60290,7 +60290,7 @@ glabel func0f085eac /* f084728: 80af004c */ lb $t7,0x4c($a1) /* f08472c: 24840018 */ addiu $a0,$a0,0x18 /* f084730: afa40048 */ sw $a0,0x48($sp) -/* f084734: 0fc2bb77 */ jal handGetWeaponFunction +/* f084734: 0fc2bb77 */ jal gsetGetWeaponFunction /* f084738: afaf00fc */ sw $t7,0xfc($sp) /* f08473c: 5040000e */ beqzl $v0,.NB0f084778 /* f084740: 8fa40124 */ lw $a0,0x124($sp) @@ -60550,7 +60550,7 @@ glabel func0f085eac /* f084ad8: 15800005 */ bnez $t4,.NB0f084af0 /* f084adc: 8fa40048 */ lw $a0,0x48($sp) /* f084ae0: 8d050004 */ lw $a1,0x4($t0) -/* f084ae4: 0fc296b1 */ jal handPlayPropHitSound +/* f084ae4: 0fc296b1 */ jal gsetPlayPropHitSound /* f084ae8: 8506003a */ lh $a2,0x3a($t0) /* f084aec: 8fa80124 */ lw $t0,0x124($sp) .NB0f084af0: @@ -60795,7 +60795,7 @@ glabel func0f085eac /* f084e60: 24012710 */ addiu $at,$zero,0x2710 /* f084e64: 51a1005b */ beql $t5,$at,.NB0f084fd4 /* f084e68: 8fa80124 */ lw $t0,0x124($sp) -/* f084e6c: 0fc2bea2 */ jal handGetDamage +/* f084e6c: 0fc2bea2 */ jal gsetGetDamage /* f084e70: 8fa40048 */ lw $a0,0x48($sp) /* f084e74: 8fae011c */ lw $t6,0x11c($sp) /* f084e78: 2401000d */ addiu $at,$zero,0xd @@ -68181,10 +68181,10 @@ u32 var8006ad88 = 0x00000000; struct weaponobj *func0f08b880(s32 modelnum, s32 weaponnum, struct chrdata *chr) { - struct shorthand hand = {0}; - hand.weaponnum = weaponnum; + struct gset gset = {0}; + gset.weaponnum = weaponnum; - return func0f08b658(modelnum, &hand, chr); + return func0f08b658(modelnum, &gset, chr); } void chrSetObjHiddenFlag4OnWeapon(struct chrdata *chr, s32 hand) @@ -73999,9 +73999,9 @@ glabel var7f1ab214 .L0f091a70: /* f091a70: 27a40094 */ addiu $a0,$sp,0x94 /* f091a74: 8fa50214 */ lw $a1,0x214($sp) -/* f091a78: 0fc29f66 */ jal handPlayPropHitSound +/* f091a78: 0fc29f66 */ jal gsetPlayPropHitSound /* f091a7c: 2406ffff */ addiu $a2,$zero,-1 -/* f091a80: 0fc2c74a */ jal handGetDamage +/* f091a80: 0fc2c74a */ jal gsetGetDamage /* f091a84: 27a40094 */ addiu $a0,$sp,0x94 /* f091a88: 8fab0204 */ lw $t3,0x204($sp) /* f091a8c: 8faa0214 */ lw $t2,0x214($sp) @@ -74048,7 +74048,7 @@ glabel var7f1ab214 /* f091b24: afa9006c */ sw $t1,0x6c($sp) /* f091b28: 27a40094 */ addiu $a0,$sp,0x94 /* f091b2c: 01002825 */ or $a1,$t0,$zero -/* f091b30: 0fc29f66 */ jal handPlayPropHitSound +/* f091b30: 0fc29f66 */ jal gsetPlayPropHitSound /* f091b34: 2406ffff */ addiu $a2,$zero,-1 .L0f091b38: /* f091b38: 8fab006c */ lw $t3,0x6c($sp) @@ -74080,7 +74080,7 @@ glabel var7f1ab214 /* f091b9c: 24091388 */ addiu $t1,$zero,0x1046 /* f091ba0: a54902d8 */ sh $t1,0x2d8($t2) .L0f091ba4: -/* f091ba4: 0fc2c74a */ jal handGetDamage +/* f091ba4: 0fc2c74a */ jal gsetGetDamage /* f091ba8: 27a40094 */ addiu $a0,$sp,0x94 /* f091bac: 8fa80070 */ lw $t0,0x70($sp) /* f091bb0: 8fac01d8 */ lw $t4,0x1d8($sp) @@ -74118,7 +74118,7 @@ glabel var7f1ab214 /* f091c28: afb80068 */ sw $t8,0x68($sp) /* f091c2c: 27a40094 */ addiu $a0,$sp,0x94 /* f091c30: 01e02825 */ or $a1,$t7,$zero -/* f091c34: 0fc29f66 */ jal handPlayPropHitSound +/* f091c34: 0fc29f66 */ jal gsetPlayPropHitSound /* f091c38: 2406ffff */ addiu $a2,$zero,-1 .L0f091c3c: /* f091c3c: 8fa40208 */ lw $a0,0x208($sp) @@ -74133,7 +74133,7 @@ glabel var7f1ab214 /* f091c60: afa00010 */ sw $zero,0x10($sp) /* f091c64: 0fc4be7c */ jal sparksCreate /* f091c68: afa00014 */ sw $zero,0x14($sp) -/* f091c6c: 0fc2c74a */ jal handGetDamage +/* f091c6c: 0fc2c74a */ jal gsetGetDamage /* f091c70: 27a40094 */ addiu $a0,$sp,0x94 /* f091c74: 8fa901d8 */ lw $t1,0x1d8($sp) /* f091c78: 44050000 */ mfc1 $a1,$f0 @@ -74728,9 +74728,9 @@ glabel var7f1ab214 .L0f091a70: /* f091a70: 27a40094 */ addiu $a0,$sp,0x94 /* f091a74: 8fa50214 */ lw $a1,0x214($sp) -/* f091a78: 0fc29f66 */ jal handPlayPropHitSound +/* f091a78: 0fc29f66 */ jal gsetPlayPropHitSound /* f091a7c: 2406ffff */ addiu $a2,$zero,-1 -/* f091a80: 0fc2c74a */ jal handGetDamage +/* f091a80: 0fc2c74a */ jal gsetGetDamage /* f091a84: 27a40094 */ addiu $a0,$sp,0x94 /* f091a88: 8fab0204 */ lw $t3,0x204($sp) /* f091a8c: 8faa0214 */ lw $t2,0x214($sp) @@ -74777,7 +74777,7 @@ glabel var7f1ab214 /* f091b24: afa9006c */ sw $t1,0x6c($sp) /* f091b28: 27a40094 */ addiu $a0,$sp,0x94 /* f091b2c: 01002825 */ or $a1,$t0,$zero -/* f091b30: 0fc29f66 */ jal handPlayPropHitSound +/* f091b30: 0fc29f66 */ jal gsetPlayPropHitSound /* f091b34: 2406ffff */ addiu $a2,$zero,-1 .L0f091b38: /* f091b38: 8fab006c */ lw $t3,0x6c($sp) @@ -74809,7 +74809,7 @@ glabel var7f1ab214 /* f091b9c: 24091388 */ addiu $t1,$zero,0x1388 /* f091ba0: a54902d8 */ sh $t1,0x2d8($t2) .L0f091ba4: -/* f091ba4: 0fc2c74a */ jal handGetDamage +/* f091ba4: 0fc2c74a */ jal gsetGetDamage /* f091ba8: 27a40094 */ addiu $a0,$sp,0x94 /* f091bac: 8fa80070 */ lw $t0,0x70($sp) /* f091bb0: 8fac01d8 */ lw $t4,0x1d8($sp) @@ -74847,7 +74847,7 @@ glabel var7f1ab214 /* f091c28: afb80068 */ sw $t8,0x68($sp) /* f091c2c: 27a40094 */ addiu $a0,$sp,0x94 /* f091c30: 01e02825 */ or $a1,$t7,$zero -/* f091c34: 0fc29f66 */ jal handPlayPropHitSound +/* f091c34: 0fc29f66 */ jal gsetPlayPropHitSound /* f091c38: 2406ffff */ addiu $a2,$zero,-1 .L0f091c3c: /* f091c3c: 8fa40208 */ lw $a0,0x208($sp) @@ -74862,7 +74862,7 @@ glabel var7f1ab214 /* f091c60: afa00010 */ sw $zero,0x10($sp) /* f091c64: 0fc4be7c */ jal sparksCreate /* f091c68: afa00014 */ sw $zero,0x14($sp) -/* f091c6c: 0fc2c74a */ jal handGetDamage +/* f091c6c: 0fc2c74a */ jal gsetGetDamage /* f091c70: 27a40094 */ addiu $a0,$sp,0x94 /* f091c74: 8fa901d8 */ lw $t1,0x1d8($sp) /* f091c78: 44050000 */ mfc1 $a1,$f0 diff --git a/src/game/sight.c b/src/game/sight.c index 11de64aae..841920786 100644 --- a/src/game/sight.c +++ b/src/game/sight.c @@ -168,9 +168,9 @@ void sightTick(bool sighton) u8 newtarget; s32 i; s32 index; - struct inventory_class *thing = func0f0b11bc(&g_Vars.currentplayer->hands[0].base); - struct weaponfunc *func = weaponGetFunctionById(g_Vars.currentplayer->hands[0].base.weaponnum, - g_Vars.currentplayer->hands[0].base.weaponfunc); + struct inventory_class *thing = func0f0b11bc(&g_Vars.currentplayer->hands[0].gset); + struct weaponfunc *func = weaponGetFunctionById(g_Vars.currentplayer->hands[0].gset.weaponnum, + g_Vars.currentplayer->hands[0].gset.weaponfunc); g_Vars.currentplayer->sighttimer240 += g_Vars.lvupdate240; @@ -192,7 +192,7 @@ void sightTick(bool sighton) newtarget = thing->unk18 >> 28; - if (handHasFunctionFlags(&g_Vars.currentplayer->hands[0].base, FUNCFLAG_THREATDETECTOR)) { + if (gsetHasFunctionFlags(&g_Vars.currentplayer->hands[0].gset, FUNCFLAG_THREATDETECTOR)) { newtarget = 5; } diff --git a/src/include/game/chr/chraction.h b/src/include/game/chr/chraction.h index 9463caec6..8799512b2 100644 --- a/src/include/game/chr/chraction.h +++ b/src/include/game/chr/chraction.h @@ -49,23 +49,23 @@ void chrStartAnim(struct chrdata *chr, s32 animnum, f32 startframe, f32 endframe void func0f031254(struct chrdata *chr); void chrAttack(struct chrdata *chr, struct attackanimgroup **animgroups, bool flip, bool *firing, u32 attackflags, s32 entityid, bool standing); void chrAttackAmount(struct chrdata *chr, u32 attackflags, u32 entityid, u32 maxshots); -void chrBeginDeath(struct chrdata *chr, struct coord *dir, f32 relangle, s32 hitpart, struct shorthand *hand, bool knockout, s32 aplayernum); +void chrBeginDeath(struct chrdata *chr, struct coord *dir, f32 relangle, s32 hitpart, struct gset *gset, bool knockout, s32 aplayernum); void chrBeginArgh(struct chrdata *chr, f32 angle, s32 hitpart); -void chrReactToDamage(struct chrdata *chr, struct coord *dir, f32 angle, s32 hitpart, struct shorthand *hand, s32 playernum); +void chrReactToDamage(struct chrdata *chr, struct coord *dir, f32 angle, s32 hitpart, struct gset *gset, s32 playernum); void chrYeetFromPos(struct chrdata *chr, struct coord *pos, f32 arg2); -s32 handGetBlurAmount(struct shorthand *hand); -void chrKnockOut(struct chrdata *chr, f32 angle, s32 hitpart, struct shorthand *hand); +s32 gsetGetBlurAmount(struct gset *gset); +void chrKnockOut(struct chrdata *chr, f32 angle, s32 hitpart, struct gset *gset); 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, 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 hitpart, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, s16 *arg10); -void chrDamageByImpact(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop, s32 arg5); +void chrDamageByMisc(struct chrdata *chr, f32 damage, struct coord *vector, struct gset *gset, struct prop *prop); +void chrDamageByLaser(struct chrdata *chr, f32 damage, struct coord *vector, struct gset *gset, struct prop *prop); +void func0f0341dc(struct chrdata *chr, f32 damage, struct coord *vector, struct gset *gset, struct prop *prop, u32 hitpart, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, s16 *arg10); +void chrDamageByImpact(struct chrdata *chr, f32 damage, struct coord *vector, struct gset *gset, 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 hitpart, bool damageshield, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, s16 *arg11, bool explosion, struct coord *explosionpos); +void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gset *gset, struct prop *aprop, s32 hitpart, 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); @@ -142,7 +142,7 @@ s32 func0f03e788(struct chrdata *chr, s32 turning, f32 arg2, f32 arg3, f32 arg4) bool func0f03e9f4(struct chrdata *chr, struct attackanimconfig *animcfg, s32 arg2, s32 arg3, f32 arg4); u32 func0f03f778(void); f32 chrGetAimLimitAngle(f32 sqdist); -void chrCalculateHit(struct chrdata *chr, bool *angleokptr, bool *hit, struct shorthand *hand); +void chrCalculateHit(struct chrdata *chr, bool *angleokptr, bool *hit, struct gset *gset); bool func0f03fde4(struct chrdata *chr, s32 handnum, struct coord *arg2); void chrCalculateShieldHit(struct chrdata *chr, struct coord *pos, struct coord *vector, struct modelnode **node, s32 *hitpart, struct model **model, s32 *side); void func0f04031c(struct coord *coord, f32 arg1, struct coord *coord2, f32 *arg3); diff --git a/src/include/game/game_097ba0.h b/src/include/game/game_097ba0.h index 6df40b41e..a2624d6ef 100644 --- a/src/include/game/game_097ba0.h +++ b/src/include/game/game_097ba0.h @@ -13,7 +13,7 @@ void func0f097f28(struct hand *hand, struct modelfiledata *arg1, struct inventor void func0f098030(struct hand *hand, struct modelfiledata *arg1); f32 func0f09815c(struct hand *hand); u32 func0f0981e8(void); -bool func0f098884(struct guncmd *cmd, struct shorthand *hand); +bool func0f098884(struct guncmd *cmd, struct gset *gset); void func0f0988e0(struct guncmd *cmd, s32 handnum, struct hand *hand); bool func0f098a44(struct hand *hand, s32 time); bool handIsAnimBusy(struct hand *hand); @@ -71,8 +71,8 @@ bool func0f09eae4(void); s32 func0f09ebbc(void); void func0f09ebcc(struct defaultobj *obj, struct coord *coord, s16 *rooms, Mtxf *matrix1, f32 *arg4, Mtxf *matrix2, struct prop *prop, struct coord *pos); void func0f09ed2c(struct defaultobj *obj, struct coord *coord, Mtxf *arg2, f32 *arg3, Mtxf *arg4); -struct weaponobj *func0f09ee18(struct chrdata *chr, struct shorthand *hand, struct coord *pos, s16 *rooms, Mtxf *arg4, struct coord *arg5); -void handCreateThrownProjectile(s32 handnum, struct shorthand *hand); +struct weaponobj *func0f09ee18(struct chrdata *chr, struct gset *gset, struct coord *pos, s16 *rooms, Mtxf *arg4, struct coord *arg5); +void handCreateThrownProjectile(s32 handnum, struct gset *gset); void func0f09f848(s32 handnum); void func0f09f974(s32 handnum, struct weaponfunc_shootprojectile *func); void func0f09fa20(s32 handnum); @@ -137,7 +137,7 @@ void func0f0a6c30(void); s32 func0f0a70f8(void); void func0f0a7138(Gfx **gdl); struct audiohandle **func0f0a7d5c(void); -void handPlayPropHitSound(struct shorthand *hand, struct prop *prop, s32 arg2); +void gsetPlayPropHitSound(struct gset *gset, struct prop *prop, s32 arg2); void func0f0a8404(struct coord *pos, s16 *rooms, s32 arg2); u32 func0f0a84c8(void); void handSetTriggerOn(s32 handnum, bool on); diff --git a/src/include/game/game_0b0fd0.h b/src/include/game/game_0b0fd0.h index 18efe4ee1..5130bd62e 100644 --- a/src/include/game/game_0b0fd0.h +++ b/src/include/game/game_0b0fd0.h @@ -6,11 +6,11 @@ struct weapon *weaponFindById(s32 itemid); struct weaponfunc *weaponGetFunctionById(u32 weaponnum, u32 which); -struct weaponfunc *handGetWeaponFunction2(struct shorthand *hand); -struct weaponfunc *handGetWeaponFunction(struct shorthand *hand); -struct weaponfunc *weaponGetFunction(struct shorthand *hand, s32 which); +struct weaponfunc *gsetGetWeaponFunction2(struct gset *gset); +struct weaponfunc *gsetGetWeaponFunction(struct gset *gset); +struct weaponfunc *weaponGetFunction(struct gset *gset, s32 which); struct weaponfunc *currentPlayerGetWeaponFunction(u32 hand); -struct inventory_class *func0f0b11bc(struct shorthand *hand); +struct inventory_class *func0f0b11bc(struct gset *gset); struct inventory_ammo *weaponGetAmmoByFunction(u32 weaponnum, u32 funcnum); f32 handGetXShift(s32 handnum); f32 func0f0b131c(s32 handnum); @@ -24,18 +24,18 @@ s32 currentPlayerGetDeviceState(s32 weaponnum); void currentPlayerSetDeviceActive(s32 weaponum, bool active); u16 weaponGetModelNum(s32 weaponnum); u16 weaponGetModelNum2(s32 weaponnum); -void handPopulateFromCurrentPlayer(s32 handnum, struct shorthand *hand); -struct inventory_ammo *handGetAmmoDefinition(struct shorthand *hand); -u8 handGetSingleUnk3c(struct shorthand *hand); -f32 handGetStrength(struct shorthand *hand); -f32 handGetDamage(struct shorthand *hand); -u8 handGetSingleUnk38(struct shorthand *hand); -u16 handGetSingleShootSound(struct shorthand *hand); -bool handHasFunctionFlags(struct shorthand *hand, u32 flags); +void handPopulateFromCurrentPlayer(s32 handnum, struct gset *gset); +struct inventory_ammo *gsetGetAmmoDefinition(struct gset *gset); +u8 gsetGetSingleUnk3c(struct gset *gset); +f32 gsetGetStrength(struct gset *gset); +f32 gsetGetDamage(struct gset *gset); +u8 gsetGetSingleUnk38(struct gset *gset); +u16 gsetGetSingleShootSound(struct gset *gset); +bool gsetHasFunctionFlags(struct gset *gset, u32 flags); s8 weaponGetNumTicksPerShot(u32 weaponnum, u32 funcindex); u32 currentPlayerGetSight(void); -void func0f0b201c(struct shorthand *hand, f32 *arg1); -struct guncmd *handGetPriToSecAnim(struct shorthand *hand); -struct guncmd *handGetSecToPriAnim(struct shorthand *hand); +void func0f0b201c(struct gset *gset, f32 *arg1); +struct guncmd *gsetGetPriToSecAnim(struct gset *gset); +struct guncmd *gsetGetSecToPriAnim(struct gset *gset); #endif diff --git a/src/include/game/mpstats.h b/src/include/game/mpstats.h index 547fa2d17..c736bfdb5 100644 --- a/src/include/game/mpstats.h +++ b/src/include/game/mpstats.h @@ -4,8 +4,8 @@ #include "data.h" #include "types.h" -void mpstatsIncrementPlayerShotCount(struct shorthand *hand, s32 region); -void mpstatsIncrementPlayerShotCount2(struct shorthand *hand, s32 region); +void mpstatsIncrementPlayerShotCount(struct gset *gset, s32 region); +void mpstatsIncrementPlayerShotCount2(struct gset *gset, s32 region); void mpstats0f0b0520(void); s32 mpstatsGetPlayerShotCountByRegion(u32 type); void mpstatsIncrementTotalKillCount(void); diff --git a/src/include/game/prop.h b/src/include/game/prop.h index 5cc0a36cd..f8c490a98 100644 --- a/src/include/game/prop.h +++ b/src/include/game/prop.h @@ -24,7 +24,7 @@ void func0f060db8(s32 handnum, bool arg1, struct coord *arg2, struct coord *arg3 struct prop *func0f061d54(s32 handnum, u32 arg1, u32 arg2); void handCreateBulletRaycast(s32 handnum, bool arg1, bool dorandom, s32 arg3, bool arg4); u32 func0f061fa8(void); -void handInflictCloseRangeDamage(s32 handnum, struct shorthand *hand, bool arg2); +void handInflictCloseRangeDamage(s32 handnum, struct gset *gset, bool arg2); void handTickAttack(s32 handnum); void handsTickAttack(void); void func0f062b64(struct prop *prop, s32 arg1); diff --git a/src/include/game/propobj.h b/src/include/game/propobj.h index 77841d3d9..2422612c6 100644 --- a/src/include/game/propobj.h +++ b/src/include/game/propobj.h @@ -285,8 +285,8 @@ u32 func0f08ae54(struct defaultobj *obj, struct chrdata *chr); u32 func0f08b108(struct weaponobj *weapon, struct chrdata *chr, struct modelfiledata *modelfiledata, u32 arg3, u32 arg4); void func0f08b208(struct weaponobj *weapon, struct chrdata *chr); void func0f08b25c(struct weaponobj *weapon, struct chrdata *chr); -struct weaponobj *func0f08b27c(s32 modelnum, struct shorthand *hand, struct chrdata *chr); -struct weaponobj *func0f08b658(s32 modelnum, struct shorthand *hand, struct chrdata *chr); +struct weaponobj *func0f08b27c(s32 modelnum, struct gset *gset, struct chrdata *chr); +struct weaponobj *func0f08b658(s32 modelnum, struct gset *gset, struct chrdata *chr); struct weaponobj *func0f08b880(s32 modelnum, s32 weaponnum, struct chrdata *chr); void chrSetObjHiddenFlag4OnWeapon(struct chrdata *chr, s32 hand); struct prop *func0f08b8e8(struct chrdata *chr, s32 weaponnum, s32 arg2, u32 flags, s32 arg4, s32 arg5); diff --git a/src/include/types.h b/src/include/types.h index 0ed9ac108..49d54b98c 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -1057,8 +1057,8 @@ struct act_argh { /*0x30*/ s32 lvframe60; }; -// The first 4 bytes of the hand struct -struct shorthand { +// Gun settings +struct gset { u8 weaponnum; u8 unk0639; u8 unk063a; @@ -1069,7 +1069,7 @@ struct act_preargh { /*0x2c*/ struct coord dir; /*0x38*/ f32 relshotdir; /*0x3c*/ s32 hitpart; - /*0x40*/ struct shorthand hand; + /*0x40*/ struct gset gset; /*0x44*/ s32 aplayernum; }; @@ -2154,7 +2154,7 @@ struct abmag { // Weapon data per hand struct hand { - struct shorthand base; + struct gset gset; /*0x063c*/ s8 firing; /*0x063d*/ s8 flashon; /*0x063e*/ u8 gunon;