Rename "close" gun function type to "melee"

This commit is contained in:
Ryan Dwyer 2022-12-02 22:46:40 +10:00
parent c20a31db57
commit 0063dcc71c
17 changed files with 98 additions and 98 deletions

View File

@ -1142,7 +1142,7 @@ bool bgun0f0990b0(struct weaponfunc *basefunc, struct weapon *weapon)
return true;
}
if ((basefunc->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) {
if ((basefunc->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
return true;
}
@ -1269,7 +1269,7 @@ s32 bgunTickIncIdle(struct handweaponinfo *info, s32 handnum, struct hand *hand,
if (info->gunctrl->wantammo) {
func = weaponGetFunction(&hand->gset, 1 - hand->gset.weaponfunc);
if ((func->type & 0xff) != INVENTORYFUNCTYPE_CLOSE) {
if ((func->type & 0xff) != INVENTORYFUNCTYPE_MELEE) {
sp30 = -1;
}
} else {
@ -2369,7 +2369,7 @@ const char var7f1ab938[] = "GiveMem: %d\n";
u32 var8007012c = 0x00000000;
u32 var80070130 = 0x00000000;
bool bgunTickIncAttackingClose(s32 handnum, struct hand *hand)
bool bgunTickIncAttackingMelee(s32 handnum, struct hand *hand)
{
struct weaponfunc *func = gsetGetWeaponFunction(&hand->gset);
@ -2384,7 +2384,7 @@ bool bgunTickIncAttackingClose(s32 handnum, struct hand *hand)
}
hand->firing = true;
hand->attacktype = HANDATTACKTYPE_CLOSERANGE;
hand->attacktype = HANDATTACKTYPE_MELEE;
hand->burstbullets++;
if (hand->triggeron) {
@ -2404,7 +2404,7 @@ bool bgunTickIncAttackingClose(s32 handnum, struct hand *hand)
if (hand->stateminor == 0) {
if (hand->statecycles == 0) {
hand->firing = true;
hand->attacktype = HANDATTACKTYPE_CLOSERANGENOUNCLOAK;
hand->attacktype = HANDATTACKTYPE_MELEENOUNCLOAK;
if (func->fire_animation) {
bgunStartAnimation(func->fire_animation, handnum, hand);
@ -2433,7 +2433,7 @@ bool bgunTickIncAttackingClose(s32 handnum, struct hand *hand)
if (hand->stateminor == 1) {
hand->firing = true;
hand->attacktype = HANDATTACKTYPE_CLOSERANGE;
hand->attacktype = HANDATTACKTYPE_MELEE;
if (hand->gset.weaponnum == WEAPON_TRANQUILIZER && func->ammoindex >= 0) {
if (hand->loadedammo[func->ammoindex] > bgunGetMinClipQty(WEAPON_TRANQUILIZER, FUNC_SECONDARY)) {
@ -2691,8 +2691,8 @@ s32 bgunTickIncAttack(struct handweaponinfo *info, s32 handnum, struct hand *han
case INVENTORYFUNCTYPE_THROW:
finished = bgunTickIncAttackingThrow(handnum, hand);
break;
case INVENTORYFUNCTYPE_CLOSE:
finished = bgunTickIncAttackingClose(handnum, hand);
case INVENTORYFUNCTYPE_MELEE:
finished = bgunTickIncAttackingMelee(handnum, hand);
break;
case INVENTORYFUNCTYPE_SPECIAL:
finished = bgunTickIncAttackingSpecial(hand);
@ -6140,7 +6140,7 @@ bool bgun0f0a27c8(void)
func = gsetGetWeaponFunction2(&hand->gset);
if (func
&& (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE
&& (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE
&& hand->state == HANDSTATE_ATTACK
&& hand->unk0ce8 != NULL
&& hand->animmode == HANDANIMMODE_BUSY
@ -6154,7 +6154,7 @@ bool bgun0f0a27c8(void)
func = gsetGetWeaponFunction2(&hand->gset);
if (func
&& (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE
&& (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE
&& hand->state == HANDSTATE_ATTACK
&& hand->unk0ce8 != NULL
&& hand->animmode == HANDANIMMODE_BUSY
@ -6180,7 +6180,7 @@ bool bgun0f0a28d8(void)
func = gsetGetWeaponFunction2(&hand->gset);
if (func
&& (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE
&& (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE
&& hand->state == HANDSTATE_ATTACK
&& hand->unk0ce8 != NULL
&& hand->animmode == HANDANIMMODE_BUSY) {
@ -6193,7 +6193,7 @@ bool bgun0f0a28d8(void)
func = gsetGetWeaponFunction2(&hand->gset);
if (func
&& (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE
&& (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE
&& hand->state == HANDSTATE_ATTACK
&& hand->unk0ce8 != NULL
&& hand->animmode == HANDANIMMODE_BUSY) {
@ -7407,7 +7407,7 @@ void bgunCreateFx(struct hand *hand, s32 handnum, struct weaponfunc *funcdef, s3
}
if (funcdef) {
if ((funcdef->type & 0xff) == INVENTORYFUNCTYPE_CLOSE || (funcdef->type & INVENTORYFUNCTYPE_0200)) {
if ((funcdef->type & 0xff) == INVENTORYFUNCTYPE_MELEE || (funcdef->type & INVENTORYFUNCTYPE_0200)) {
createbeam = false;
}

View File

@ -81,7 +81,7 @@ bool bmoveIsAutoAimYEnabledForCurrentWeapon(void)
return false;
}
if ((func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) {
if ((func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
return true;
}
}
@ -139,7 +139,7 @@ bool bmoveIsAutoAimXEnabledForCurrentWeapon(void)
return false;
}
if ((func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) {
if ((func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
return true;
}
}

View File

@ -115,7 +115,7 @@ void botReset(struct chrdata *chr, u8 respawning)
aibot->weaponnum = WEAPON_UNARMED;
aibot->gunfunc = FUNC_PRIMARY;
aibot->iscloserangeweapon = true;
aibot->ismeleeweapon = true;
aibot->loadedammo[0] = 0;
aibot->loadedammo[1] = 0;
aibot->gotoprop = NULL;
@ -990,7 +990,7 @@ s32 botTick(struct prop *prop)
chrSetLookAngle(chr, newangle);
if (chr->target != -1 && !aibot->iscloserangeweapon) {
if (chr->target != -1 && !aibot->ismeleeweapon) {
bool left = chr->weapons_held[HAND_LEFT] ? true : false;
bool right = (0, chr->weapons_held[HAND_RIGHT] ? true : false);
@ -2430,7 +2430,7 @@ void botTickUnpaused(struct chrdata *chr)
// Bot doesn't have the weapon it was told to switch to
chr->aibot->weaponnum = WEAPON_UNARMED;
chr->aibot->gunfunc = FUNC_PRIMARY;
chr->aibot->iscloserangeweapon = 1;
chr->aibot->ismeleeweapon = true;
}
aibot->throwtimer60 = 0;
@ -3332,7 +3332,7 @@ void botTickUnpaused(struct chrdata *chr)
}
if (aibot->skrocket == NULL && aibot->changeguntimer60 <= 0) {
if (aibot->iscloserangeweapon) {
if (aibot->ismeleeweapon) {
// Consider punching, pistol whipping etc
// Despite the name, punchtimer60 is used for all close
// range attacks. Its value is 0 if not currently

View File

@ -425,7 +425,7 @@ s32 botactGetShootInterval60(s32 weaponnum, s32 funcnum)
} else if (func->type == INVENTORYFUNCTYPE_SHOOT_PROJECTILE) {
struct weaponfunc_shoot *func2 = (struct weaponfunc_shoot *)func;
result = func2->unk24 + func2->unk25;
} else if (func->type == INVENTORYFUNCTYPE_CLOSE && weaponnum != WEAPON_REAPER) {
} else if (func->type == INVENTORYFUNCTYPE_MELEE && weaponnum != WEAPON_REAPER) {
result = 60;
}
}

View File

@ -1103,7 +1103,7 @@ bool botinvSwitchToWeapon(struct chrdata *chr, s32 weaponnum, s32 funcnum)
func = weaponGetFunctionById(weaponnum, funcnum);
aibot->iscloserangeweapon = func && func->type == INVENTORYFUNCTYPE_CLOSE;
aibot->ismeleeweapon = func && func->type == INVENTORYFUNCTYPE_MELEE;
for (i = 0; i < 2; i++) {
if (chr->weapons_held[i]) {

View File

@ -176,7 +176,7 @@ void botmgrAllocateBot(s32 chrnum, s32 aibotnum)
aibot->unk0a0 = 0;
aibot->gunfunc = FUNC_PRIMARY;
aibot->iscloserangeweapon = true;
aibot->ismeleeweapon = true;
aibot->teamisonlyai = false;
aibot->hasbriefcase = false;
aibot->hascase = false;

View File

@ -5152,12 +5152,12 @@ void chrHit(struct shotdata *shotdata, struct hit *hit)
struct coord hitpos;
struct coord sp98;
s16 sp90[3];
u8 isclose = false;
u8 ismelee = false;
struct weaponfunc *func = gsetGetWeaponFunction(&shotdata->gset);
f32 shield;
if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) {
isclose = true;
if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
ismelee = true;
}
// The prop that was hit could be an item held by the chr,
@ -5306,7 +5306,7 @@ void chrHit(struct shotdata *shotdata, struct hit *hit)
&& race != RACE_DRCAROLL
&& race != RACE_ROBOT
&& race != RACE_EYESPY
&& !isclose
&& !ismelee
&& shotdata->gset.weaponnum != WEAPON_TRANQUILIZER) {
u8 darker;
@ -5330,7 +5330,7 @@ void chrHit(struct shotdata *shotdata, struct hit *hit)
&& race != RACE_DRCAROLL
&& race != RACE_ROBOT
&& race != RACE_EYESPY
&& !isclose
&& !ismelee
&& shotdata->gset.weaponnum != WEAPON_TRANQUILIZER) {
u8 darker;

View File

@ -4248,7 +4248,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gse
s32 race = CHRRACE(chr);
f32 shield;
bool makedizzy;
bool isclose;
bool ismelee;
struct prop *vprop = chr->prop;
f32 headshotdamagescale = 1;
bool usedshield = false;
@ -4258,7 +4258,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gse
f32 explosionforce = damage;
f32 healthscale = 1;
f32 armourscale = 1;
bool isfar = true;
bool isshoot = true;
bool forceapplydamage = false;
struct weaponfunc *func;
f32 amount;
@ -4338,15 +4338,15 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gse
}
func = gsetGetWeaponFunction(gset);
isclose = func && (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE;
ismelee = func && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE;
makedizzy = race != RACE_DRCAROLL && gsetHasFunctionFlags(gset, FUNCFLAG_MAKEDIZZY);
if (chr->prop == g_Vars.currentplayer->prop && g_Vars.currentplayer->invincible) {
return;
}
if (isclose) {
isfar = false;
if (ismelee) {
isshoot = false;
}
// Set a flag on the victim that makes them switch to their "shot" AI list
@ -4633,7 +4633,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gse
// If chr is dying or already dead, consider making their head flinch
// then we're done
if (chr->actiontype == ACT_DIE || chr->actiontype == ACT_DEAD) {
if (hitpart == HITPART_HEAD && chr->actiontype == ACT_DIE && race != RACE_SKEDAR && isfar) {
if (hitpart == HITPART_HEAD && chr->actiontype == ACT_DIE && race != RACE_SKEDAR && isshoot) {
struct coord pos;
pos.x = vprop->pos.x - vector->x;
pos.y = vprop->pos.y - vector->y;
@ -4708,7 +4708,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gse
} else {
damage *= 4;
if (isfar && !usedshield) {
if (isshoot && !usedshield) {
chrFlinchHead(chr, angle);
damage *= headshotdamagescale;
@ -4809,7 +4809,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gse
}
// Handle player boost
if (isclose && gset->weaponnum == WEAPON_REAPER) {
if (ismelee && gset->weaponnum == WEAPON_REAPER) {
boostscale = 0.1f;
} else if (g_Vars.normmplayerisrunning) {
boostscale = 0.75f;
@ -4894,7 +4894,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gse
if (chr->aibot) {
f32 boostscale;
if (isclose && gset->weaponnum == WEAPON_REAPER) {
if (ismelee && gset->weaponnum == WEAPON_REAPER) {
boostscale = 0.1f;
} else {
boostscale = 0.75f;

View File

@ -467,13 +467,13 @@ f32 gsetGetDamage(struct gset *gset)
if (func) {
if ((func->type & 0xff) == INVENTORYFUNCTYPE_SHOOT) {
struct weaponfunc_shoot *fullfunc = (struct weaponfunc_shoot *)func;
damage = fullfunc->damage;
struct weaponfunc_shoot *shootfunc = (struct weaponfunc_shoot *)func;
damage = shootfunc->damage;
}
if ((func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) {
struct weaponfunc_close *fullfunc = (struct weaponfunc_close *)func;
damage = fullfunc->damage;
if ((func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
struct weaponfunc_melee *meleefunc = (struct weaponfunc_melee *)func;
damage = meleefunc->damage;
if (gset->weaponnum == WEAPON_REAPER) {
damage *= LVUPDATE60FREAL();
@ -481,8 +481,8 @@ f32 gsetGetDamage(struct gset *gset)
}
if ((func->type & 0xff) == INVENTORYFUNCTYPE_THROW) {
struct weaponfunc_throw *fullfunc = (struct weaponfunc_throw *)func;
damage = fullfunc->damage;
struct weaponfunc_throw *throwfunc = (struct weaponfunc_throw *)func;
damage = throwfunc->damage;
}
}
@ -577,7 +577,7 @@ u32 currentPlayerGetSight(void)
g_Vars.currentplayer->hands[HAND_RIGHT].gset.weaponnum,
g_Vars.currentplayer->hands[HAND_RIGHT].gset.weaponfunc);
if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) {
if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
return SIGHT_NONE;
}

View File

@ -262,8 +262,8 @@ struct guncmd invanim_punch[] = {
gunscript_end
};
struct weaponfunc_close invfunc_unarmed_punch = {
INVENTORYFUNCTYPE_CLOSE,
struct weaponfunc_melee invfunc_unarmed_punch = {
INVENTORYFUNCTYPE_MELEE,
L_GUN_100, // name
0, // unused
-1, // ammoindex
@ -286,8 +286,8 @@ struct weaponfunc_close invfunc_unarmed_punch = {
0, // unused
};
struct weaponfunc_close invfunc_unarmed_disarm = {
INVENTORYFUNCTYPE_CLOSE,
struct weaponfunc_melee invfunc_unarmed_disarm = {
INVENTORYFUNCTYPE_MELEE,
L_GUN_101, // name
0, // unused
-1, // ammoindex
@ -526,8 +526,8 @@ struct weaponfunc_shootsingle invfunc_falcon2silenced_singleshot = {
1, // penetration
};
struct weaponfunc_close invfunc_falcon2_pistolwhip = {
INVENTORYFUNCTYPE_CLOSE,
struct weaponfunc_melee invfunc_falcon2_pistolwhip = {
INVENTORYFUNCTYPE_MELEE,
L_GUN_094, // name
0, // unused
-1, // ammoindex
@ -935,8 +935,8 @@ struct weaponfunc_shootsingle invfunc_dy357lx_singleshot = {
5, // penetration
};
struct weaponfunc_close invfunc_dy357_pistolwhip = {
INVENTORYFUNCTYPE_CLOSE,
struct weaponfunc_melee invfunc_dy357_pistolwhip = {
INVENTORYFUNCTYPE_MELEE,
L_GUN_094, // name
0, // unused
-1, // ammoindex
@ -2656,8 +2656,8 @@ struct weaponfunc_shootauto invfunc_reaper_shoot = {
88, // turretdecel
};
struct weaponfunc_close invfunc_reaper_grind = {
INVENTORYFUNCTYPE_CLOSE,
struct weaponfunc_melee invfunc_reaper_grind = {
INVENTORYFUNCTYPE_MELEE,
L_GUN_106, // name
0, // unused
-1, // ammoindex
@ -3858,8 +3858,8 @@ struct weaponfunc_shootsingle invfunc_tranquilizer_shoot = {
1, // penetration
};
struct weaponfunc_close invfunc_tranquilizer_lethal = {
INVENTORYFUNCTYPE_CLOSE,
struct weaponfunc_melee invfunc_tranquilizer_lethal = {
INVENTORYFUNCTYPE_MELEE,
L_GUN_108, // name
0, // unused
0, // ammoindex
@ -4899,8 +4899,8 @@ struct guncmd invanim_combatknife_reload[] = {
gunscript_end
};
struct weaponfunc_close invfunc_combatknife_slash = {
INVENTORYFUNCTYPE_CLOSE,
struct weaponfunc_melee invfunc_combatknife_slash = {
INVENTORYFUNCTYPE_MELEE,
L_GUN_109, // name
0, // unused
0, // ammoindex

View File

@ -635,7 +635,7 @@ struct prop *shotCalculateHits(s32 handnum, bool arg1, struct coord *arg2, struc
explosiveshells = true;
}
if ((func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE && arg1) {
if ((func->type & 0xff) == INVENTORYFUNCTYPE_MELEE && arg1) {
shortrange = true;
arg1 = false;
}
@ -664,9 +664,9 @@ struct prop *shotCalculateHits(s32 handnum, bool arg1, struct coord *arg2, struc
hitpos.y = shotdata.gunpos.y + shotdata.dir.y * 300;
hitpos.z = shotdata.gunpos.z + shotdata.dir.z * 300;
} else if (shortrange) {
if ((func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) {
struct weaponfunc_close *close = (struct weaponfunc_close *) func;
range = close->range;
if ((func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
struct weaponfunc_melee *meleefunc = (struct weaponfunc_melee *) func;
range = meleefunc->range;
}
hitpos.x = shotdata.gunpos.x + shotdata.dir.x * range;
@ -829,7 +829,7 @@ struct prop *shotCalculateHits(s32 handnum, bool arg1, struct coord *arg2, struc
bgunSetHitPos(&sp694.unk00);
if (surfacetype->numwallhittexes > 0 && (!func || (func->type & 0xff) != INVENTORYFUNCTYPE_CLOSE)) {
if (surfacetype->numwallhittexes > 0 && (!func || (func->type & 0xff) != INVENTORYFUNCTYPE_MELEE)) {
if (shotdata.gset.weaponnum != WEAPON_UNARMED
&& shotdata.gset.weaponnum != WEAPON_LASER
&& shotdata.gset.weaponnum != WEAPON_TRANQUILIZER
@ -1103,7 +1103,7 @@ void func0f061fa8(struct shotdata *shotdata, struct prop *prop, f32 arg2, s32 hi
}
}
void handInflictCloseRangeDamage(s32 handnum, struct gset *gset, bool arg2)
void handInflictMeleeDamage(s32 handnum, struct gset *gset, bool arg2)
{
s32 cdtypes;
struct prop **ptr;
@ -1170,9 +1170,9 @@ void handInflictCloseRangeDamage(s32 handnum, struct gset *gset, bool arg2)
struct model *model;
struct weaponfunc *func = gsetGetWeaponFunction(gset);
if ((func->type & 0xff) == 3) {
struct weaponfunc_close *closefunc = (struct weaponfunc_close *)func;
rangelimit = closefunc->range;
if ((func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
struct weaponfunc_melee *meleefunc = (struct weaponfunc_melee *)func;
rangelimit = meleefunc->range;
}
bgunGetCrossPos(&x, &y);
@ -1308,12 +1308,12 @@ void handTickAttack(s32 handnum)
mpstats0f0b0520();
}
break;
case HANDATTACKTYPE_CLOSERANGE:
case HANDATTACKTYPE_MELEE:
chrUncloakTemporarily(g_Vars.currentplayer->prop->chr);
handInflictCloseRangeDamage(handnum, &gset, false);
handInflictMeleeDamage(handnum, &gset, false);
break;
case HANDATTACKTYPE_CLOSERANGENOUNCLOAK:
handInflictCloseRangeDamage(handnum, &gset, true);
case HANDATTACKTYPE_MELEENOUNCLOAK:
handInflictMeleeDamage(handnum, &gset, true);
break;
case HANDATTACKTYPE_DETONATE:
playerActivateRemoteMineDetonator(g_Vars.currentplayernum);
@ -2548,14 +2548,14 @@ void autoaimTick(void)
{
struct prop *bestprop = NULL;
f32 aimpos[2] = {0, 0};
bool isclose = false;
bool ismelee = false;
bool cangangsta = weaponHasFlag(bgunGetWeaponNum(HAND_RIGHT), WEAPONFLAG_GANGSTA);
bool iscmpsec = false;
struct weaponfunc *func = currentPlayerGetWeaponFunction(HAND_RIGHT);
s32 i;
if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) {
isclose = true;
if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
ismelee = true;
}
if (frIsInTraining()) {
@ -2661,7 +2661,7 @@ void autoaimTick(void)
}
} else if ((bmoveIsAutoAimYEnabledForCurrentWeapon()
|| bmoveIsAutoAimXEnabledForCurrentWeapon()
|| cangangsta) && !isclose) {
|| cangangsta) && !ismelee) {
// Standard auto aim
f32 bestthing = -1;
struct prop *prop;

View File

@ -15654,7 +15654,7 @@ void objHit(struct shotdata *shotdata, struct hit *hit)
struct defaultobj *obj;
struct coord sp110;
struct prop *prop;
u8 isclosefunc = false;
u8 ismeleefunc = false;
s32 i;
bool explosiveshells = false;
bool spfc = hit->unk4c;
@ -15666,8 +15666,8 @@ void objHit(struct shotdata *shotdata, struct hit *hit)
s16 spdc[3];
if (func != NULL) {
if ((func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) {
isclosefunc = true;
if ((func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
ismeleefunc = true;
}
if (func->flags & FUNCFLAG_EXPLOSIVESHELLS) {
@ -15721,7 +15721,7 @@ void objHit(struct shotdata *shotdata, struct hit *hit)
}
// Create sparks
if (!isclosefunc) {
if (!ismeleefunc) {
if (chrIsUsingPaintball(g_Vars.currentplayer->prop->chr)) {
sparksCreate(prop->rooms[0], prop, &sp110, 0, 0, SPARKTYPE_PAINT);
} else {
@ -15746,12 +15746,12 @@ void objHit(struct shotdata *shotdata, struct hit *hit)
// Play hit sound
if (!spfc) {
bgunPlayGlassHitSound(&hit->prop->pos, hit->prop->rooms, hit->hitthing.texturenum);
} else if (!isclosefunc) {
} else if (!ismeleefunc) {
bgunPlayPropHitSound(&shotdata->gset, hit->prop, hit->hitthing.texturenum);
}
// Create wall hit (bullet hole)
if (!isclosefunc
if (!ismeleefunc
&& hit->hitthing.texturenum != 10000
&& shotdata->gset.weaponnum != WEAPON_UNARMED
&& shotdata->gset.weaponnum != WEAPON_LASER

View File

@ -188,7 +188,7 @@ void sightTick(bool sighton)
newtracktype = SIGHTTRACKTYPE_THREATDETECTOR;
}
if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) {
if (func && (func->type & 0xff) == INVENTORYFUNCTYPE_MELEE) {
newtracktype = SIGHTTRACKTYPE_NONE;
}

View File

@ -1234,17 +1234,17 @@
#define HANDANIMMODE_IDLE 0
#define HANDANIMMODE_BUSY 2
#define HANDATTACKTYPE_SHOOT 1
#define HANDATTACKTYPE_SHOOTPROJECTILE 2
#define HANDATTACKTYPE_THROWPROJECTILE 3
#define HANDATTACKTYPE_CLOSERANGE 4
#define HANDATTACKTYPE_DETONATE 5
#define HANDATTACKTYPE_BOOST 6
#define HANDATTACKTYPE_REVERTBOOST 7
#define HANDATTACKTYPE_CROUCH 8
#define HANDATTACKTYPE_RCP120CLOAK 9
#define HANDATTACKTYPE_CLOSERANGENOUNCLOAK 10
#define HANDATTACKTYPE_UPLINK 12
#define HANDATTACKTYPE_SHOOT 1
#define HANDATTACKTYPE_SHOOTPROJECTILE 2
#define HANDATTACKTYPE_THROWPROJECTILE 3
#define HANDATTACKTYPE_MELEE 4
#define HANDATTACKTYPE_DETONATE 5
#define HANDATTACKTYPE_BOOST 6
#define HANDATTACKTYPE_REVERTBOOST 7
#define HANDATTACKTYPE_CROUCH 8
#define HANDATTACKTYPE_RCP120CLOAK 9
#define HANDATTACKTYPE_MELEENOUNCLOAK 10
#define HANDATTACKTYPE_UPLINK 12
#define HANDMODE_NONE 0
#define HANDMODE_1 1
@ -1416,7 +1416,7 @@
#define INVENTORYFUNCTYPE_SHOOT_PROJECTILE 0x0201
#define INVENTORYFUNCTYPE_0200 0x0200
#define INVENTORYFUNCTYPE_THROW 0x0002
#define INVENTORYFUNCTYPE_CLOSE 0x0003
#define INVENTORYFUNCTYPE_MELEE 0x0003
#define INVENTORYFUNCTYPE_SPECIAL 0x0004
#define INVENTORYFUNCTYPE_DEVICE 0x0005

View File

@ -41,7 +41,7 @@ bool bgun0f09aba4(struct hand *hand, struct handweaponinfo *info, s32 handnum, s
bool bgunTickIncAttackingShoot(struct handweaponinfo *info, s32 handnum, struct hand *hand);
bool bgunTickIncAttackingThrow(s32 handnum, struct hand *hand);
s32 bgunGetMinClipQty(s32 weaponnum, s32 funcnum);
bool bgunTickIncAttackingClose(s32 handnum, struct hand *hand);
bool bgunTickIncAttackingMelee(s32 handnum, struct hand *hand);
bool bgunTickIncAttackingSpecial(struct hand *hand);
s32 bgunTickIncAttackEmpty(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate);
s32 bgunTickIncAttack(struct handweaponinfo *info, s32 handnum, struct hand *hand, s32 lvupdate);

View File

@ -28,7 +28,7 @@ struct prop *shotCalculateHits(s32 handnum, bool arg1, struct coord *arg2, struc
struct prop *func0f061d54(s32 handnum, u32 arg1, u32 arg2);
void shotCreate(s32 handnum, bool arg1, bool dorandom, s32 arg3, bool arg4);
void func0f061fa8(struct shotdata *shotdata, struct prop *prop, f32 arg2, s32 hitpart, struct modelnode *node, struct hitthing *hitthing, s32 arg6, struct modelnode *arg7, struct model *model, bool arg9, s32 arg10, struct coord *arg11, struct coord *arg12);
void handInflictCloseRangeDamage(s32 handnum, struct gset *gset, bool arg2);
void handInflictMeleeDamage(s32 handnum, struct gset *gset, bool arg2);
void handTickAttack(s32 handnum);
void handsTickAttack(void);
void propExecuteTickOperation(struct prop *prop, s32 op);

View File

@ -725,7 +725,7 @@ struct aibot {
/*0x048*/ s16 hillpadnum;
/*0x04a*/ s16 hillcovernum;
/*0x04c*/ u8 unk04c_00 : 1;
/*0x04c*/ u8 iscloserangeweapon : 1;
/*0x04c*/ u8 ismeleeweapon : 1;
/*0x04c*/ u8 gunfunc : 1;
/*0x04c*/ u8 unk04c_03 : 1;
/*0x04c*/ u8 unk04c_04 : 1;
@ -2976,7 +2976,7 @@ struct weaponfunc_throw {
/*0x20*/ f32 damage;
};
struct weaponfunc_close {
struct weaponfunc_melee {
struct weaponfunc base;
/*0x14*/ f32 damage;
/*0x18*/ f32 range;