Skip to content
Permalink
Browse files

mod: fix deployed mortar in 3rd person view

  • Loading branch information...
Aranud committed Jun 11, 2019
1 parent 998fc01 commit 38386cf73f4385ae559d52ad8eda0850d487d8f9
Showing with 94 additions and 86 deletions.
  1. +42 −42 etmain/weapons/axis_mortar.weap
  2. +40 −40 etmain/weapons/mortar.weap
  3. +12 −4 src/cgame/cg_weapons.c
@@ -10,21 +10,21 @@ weaponDef
weaponConfig "models/multiplayer/mortar/weapon.cfg"
handsModel "models/multiplayer/mortar/v_mortar_hand.md3"

flashDlightColor 1 0.7 0.5
//flashSound "" // supports up to 4 flash sounds
//flashEchoSound "" // supports up to 4 flash echo sounds
//lastShotSound "" // supports up to 4 last shot sounds

//readySound ""
//firingSound "" // no weapons seem to use this, basically it's a replacement hum for readysound, but then when firing
//overheatSound ""
//reloadSound ""
//reloadFastSound "" // some weapons have fast reloads due to the skill system
spinupSound "sound/weapons/mortar/mortar_fire.wav" // sound started when fire button goes down, and stepped on when the first fire event happens
//spindownSound "" // sound called if the above is running but player doesn't follow through and fire
switchSound "sound/weapons/mortar/mortar_on.wav" // allow overriding of weaponswitch sound
noAmmoSound "sound/weapons/misc/fire_dry.wav"
flashDlightColor 1 0.7 0.5
//flashSound "" // supports up to 4 flash sounds
//flashEchoSound "" // supports up to 4 flash echo sounds
//lastShotSound "" // supports up to 4 last shot sounds

//readySound ""
//firingSound "" // no weapons seem to use this, basically it's a replacement hum for readysound, but then when firing
//overheatSound ""
//reloadSound ""
//reloadFastSound "" // some weapons have fast reloads due to the skill system
spinupSound "sound/weapons/mortar/mortar_fire.wav" // sound started when fire button goes down, and stepped on when the first fire event happens
//spindownSound "" // sound called if the above is running but player doesn't follow through and fire
switchSound "sound/weapons/mortar/mortar_on.wav" // allow overriding of weaponswitch sound
noAmmoSound "sound/weapons/misc/fire_dry.wav"

weaponIcon "icons/iconw_mortar_ax"
weaponIconScale 2
weaponSelectedIcon "icons/iconw_mortar_ax_1_select"
@@ -33,35 +33,35 @@ weaponDef
weaponCardScale 1 1
weaponCardPointS 0 1
weaponCardPointT 0 0.125

missileModel "models/multiplayer/mortar/mortar_shell_ax.md3"
missileSound "sound/weapons/mortar/mortar_fly.wav"
missileFallSound 3 "sound/weapons/artillery/artillery_fly_"
missileTrailFunc "GrenadeTrail" // supports "GrenadeTrail", "RocketTrail", "PyroSmokeTrail" and "DynamiteTrail" (we REALLY want a particle system for this)
//missileDlight 0
missileDlightColor 1 0.7 0.5

missileModel "models/multiplayer/mortar/mortar_shell_ax.md3"
missileSound "sound/weapons/mortar/mortar_fly.wav"
missileFallSound 3 "sound/weapons/artillery/artillery_fly_"
missileTrailFunc "GrenadeTrail" // supports "GrenadeTrail", "RocketTrail", "PyroSmokeTrail" and "DynamiteTrail" (we REALLY want a particle system for this)
//missileDlight 0
missileDlightColor 1 0.7 0.5

//ejectBrassFunc "" // supports "MachineGunEjectBrass" and "PanzerFaustEjectBrass"
//ejectBrassOffset 0 0 0

adjustLean 1 1 1

//modModel 1 ""

impactSoundRange 400
impactSoundVolume 127
impactMarkRadius 64
impactFunction "SmallExplosionImpact" // supports "MeleeImpact", "BulletImpact", "SmallExplosionImpact", "BigExplosionImpact", "MapMortarImpact" and "DynamiteExplosionImpact"

impactSound {
default "sound/weapons/mortar/mortar_expl.wav"
far "sound/weapons/mortar/mortar_expl_far.wav"
water "sound/weapons/grenade/gren_expl_water.wav"
}

impactMark { // each surface supports up to 1 marks shader. available surface : default, far, wood, metal, roof, gravel, glass, snow, water, flesh
default "gfx/damage/burn_med_mrk"
}
//ejectBrassFunc "" // supports "MachineGunEjectBrass" and "PanzerFaustEjectBrass"
//ejectBrassOffset 0 0 0

adjustLean 1 1 1

modModel 0 "models/multiplayer/mortar/mortar_3rd_ax.md3"

impactSoundRange 400
impactSoundVolume 127
impactMarkRadius 64
impactFunction "SmallExplosionImpact" // supports "MeleeImpact", "BulletImpact", "SmallExplosionImpact", "BigExplosionImpact", "MapMortarImpact" and "DynamiteExplosionImpact"

impactSound {
default "sound/weapons/mortar/mortar_expl.wav"
far "sound/weapons/mortar/mortar_expl_far.wav"
water "sound/weapons/grenade/gren_expl_water.wav"
}

impactMark { // each surface supports up to 1 marks shader. available surface : default, far, wood, metal, roof, gravel, glass, snow, water, flesh
default "gfx/damage/burn_med_mrk"
}

firstPerson {
model "models/multiplayer/mortar/v_mortar_ax.md3"
@@ -10,21 +10,21 @@ weaponDef
weaponConfig "models/multiplayer/mortar/weapon.cfg"
handsModel "models/multiplayer/mortar/v_mortar_hand.md3"

flashDlightColor 1 0.7 0.5
//flashSound "" // supports up to 4 flash sounds
//flashEchoSound "" // supports up to 4 flash echo sounds
//lastShotSound "" // supports up to 4 last shot sounds

//readySound ""
//firingSound "" // no weapons seem to use this, basically it's a replacement hum for readysound, but then when firing
//overheatSound ""
//reloadSound ""
//reloadFastSound "" // some weapons have fast reloads due to the skill system
spinupSound "sound/weapons/mortar/mortar_fire.wav" // sound started when fire button goes down, and stepped on when the first fire event happens
//spindownSound "" // sound called if the above is running but player doesn't follow through and fire
switchSound "sound/weapons/mortar/mortar_on.wav" // allow overriding of weaponswitch sound
noAmmoSound "sound/weapons/misc/fire_dry.wav"
flashDlightColor 1 0.7 0.5
//flashSound "" // supports up to 4 flash sounds
//flashEchoSound "" // supports up to 4 flash echo sounds
//lastShotSound "" // supports up to 4 last shot sounds

//readySound ""
//firingSound "" // no weapons seem to use this, basically it's a replacement hum for readysound, but then when firing
//overheatSound ""
//reloadSound ""
//reloadFastSound "" // some weapons have fast reloads due to the skill system
spinupSound "sound/weapons/mortar/mortar_fire.wav" // sound started when fire button goes down, and stepped on when the first fire event happens
//spindownSound "" // sound called if the above is running but player doesn't follow through and fire
switchSound "sound/weapons/mortar/mortar_on.wav" // allow overriding of weaponswitch sound
noAmmoSound "sound/weapons/misc/fire_dry.wav"

weaponIcon "icons/iconw_mortar"
weaponIconScale 2
weaponSelectedIcon "icons/iconw_mortar_1_select"
@@ -33,33 +33,33 @@ weaponDef
weaponCardScale 1 1
weaponCardPointS 0 1
weaponCardPointT 0 0.125

missileModel "models/multiplayer/mortar/mortar_shell.md3"
missileSound "sound/weapons/mortar/mortar_fly.wav"
missileFallSound 3 "sound/weapons/artillery/artillery_fly_"
missileTrailFunc "GrenadeTrail" // supports "GrenadeTrail", "RocketTrail", "PyroSmokeTrail" and "DynamiteTrail" (we REALLY want a particle system for this)
//missileDlight 0
missileDlightColor 1 0.7 0.5

//ejectBrassFunc "" // supports "MachineGunEjectBrass" and "PanzerFaustEjectBrass"
//ejectBrassOffset 0 0 0

adjustLean 1 1 1

missileModel "models/multiplayer/mortar/mortar_shell.md3"
missileSound "sound/weapons/mortar/mortar_fly.wav"
missileFallSound 3 "sound/weapons/artillery/artillery_fly_"
missileTrailFunc "GrenadeTrail" // supports "GrenadeTrail", "RocketTrail", "PyroSmokeTrail" and "DynamiteTrail" (we REALLY want a particle system for this)
//missileDlight 0
missileDlightColor 1 0.7 0.5

//ejectBrassFunc "" // supports "MachineGunEjectBrass" and "PanzerFaustEjectBrass"
//ejectBrassOffset 0 0 0

adjustLean 1 1 1

//modModel 1 ""

impactSoundRange 400
impactFunction "SmallExplosionImpact" // supports "MeleeImpact", "BulletImpact", "SmallExplosionImpact", "BigExplosionImpact", "MapMortarImpact" and "DynamiteExplosionImpact"
impactSoundVolume 127
impactMarkRadius 64
impactSound {
default "sound/weapons/mortar/mortar_expl.wav"
far "sound/weapons/mortar/mortar_expl_far.wav"
water "sound/weapons/grenade/gren_expl_water.wav"
}
impactMark { // each surface supports up to 1 marks shader. available surface : default, far, wood, metal, roof, gravel, glass, snow, water, flesh
default "gfx/damage/burn_med_mrk"
}
modModel 0 "models/multiplayer/mortar/mortar_3rd.md3"

impactSoundRange 400
impactFunction "SmallExplosionImpact" // supports "MeleeImpact", "BulletImpact", "SmallExplosionImpact", "BigExplosionImpact", "MapMortarImpact" and "DynamiteExplosionImpact"
impactSoundVolume 127
impactMarkRadius 64
impactSound {
default "sound/weapons/mortar/mortar_expl.wav"
far "sound/weapons/mortar/mortar_expl_far.wav"
water "sound/weapons/grenade/gren_expl_water.wav"
}
impactMark { // each surface supports up to 1 marks shader. available surface : default, far, wood, metal, roof, gravel, glass, snow, water, flesh
default "gfx/damage/burn_med_mrk"
}

firstPerson {
model "models/multiplayer/mortar/v_mortar.md3"
@@ -2286,7 +2286,7 @@ static void CG_CalculateWeaponPosition(vec3_t origin, vec3_t angles)
angles[PITCH] = cg.refdefViewAngles[PITCH] / 1.2f;
}

if (!cg.renderingThirdPerson && (cg.pmext.silencedSideArm & 4) &&
if (!cg.renderingThirdPerson && (cg.pmext.silencedSideArm & 4) &&
cg.predictedPlayerState.weaponstate != WEAPON_RAISING)
{
angles[PITCH] = cg.pmext.mountedWeaponAngles[PITCH];
@@ -2521,7 +2521,15 @@ void CG_AddPlayerWeapon(refEntity_t *parent, playerState_t *ps, centity_t *cent)
team = team == TEAM_AXIS ? TEAM_ALLIES : TEAM_AXIS;
}

gun.hModel = weapon->weaponModel[modelViewType].model;
// deployed mortar use a specific model in 3rd person
if (!isFirstPerson && (GetWeaponTableData(weaponNum)->type & WEAPON_TYPE_MORTAR) && (cg.pmext.silencedSideArm & 4))
{
gun.hModel = weapon->modModels[0];
}
else
{
gun.hModel = weapon->weaponModel[modelViewType].model;
}

if ((team == TEAM_AXIS) && weapon->weaponModel[modelViewType].skin[TEAM_AXIS])
{
@@ -2569,7 +2577,7 @@ void CG_AddPlayerWeapon(refEntity_t *parent, playerState_t *ps, centity_t *cent)
}
}

if (ps && !cg.renderingThirdPerson && (GetWeaponTableData(cg.predictedPlayerState.weapon)->type & WEAPON_TYPE_MORTAR) && (cg.pmext.silencedSideArm & 4)
if (ps && !cg.renderingThirdPerson && (GetWeaponTableData(cg.predictedPlayerState.weapon)->type & WEAPON_TYPE_MORTAR) && (cg.pmext.silencedSideArm & 4)
&& cg.predictedPlayerState.weaponstate != WEAPON_RAISING)
{
vec3_t angles;
@@ -3897,7 +3905,7 @@ void CG_AltWeapon_f(void)
return;
}

if (GetWeaponTableData(cg.weaponSelect)->type & WEAPON_TYPE_SCOPABLE)
if (GetWeaponTableData(cg.weaponSelect)->type & WEAPON_TYPE_SCOPABLE)
{
// don't allow players switching to scoped weapon when prone moving
if (cg.predictedPlayerState.eFlags & EF_PRONE_MOVING)

0 comments on commit 38386cf

Please sign in to comment.
You can’t perform that action at this time.