Permalink
Browse files

Fixed a bug in SP (in the original game?) where dismemberment was har…

…der than it needed to be. Also removed cheat flag and added archive flag to g_saberRealisticCombat, debug_subdivision, g_dismemberProbabilities
  • Loading branch information...
eezstreet authored and xycaleth committed Jan 25, 2019
1 parent cc4094c commit c5fefc66c65ebe404bf2cec8729f56641e0776b6
Showing with 10 additions and 10 deletions.
  1. +3 −3 code/game/g_main.cpp
  2. +3 −3 code/game/wp_saber.cpp
  3. +1 −1 codeJK2/game/g_main.cpp
  4. +3 −3 codeJK2/game/wp_saber.cpp
@@ -659,9 +659,9 @@ void G_InitCvars( void ) {
com_buildScript = gi.cvar ("com_buildscript", "0", 0);

g_saberAutoBlocking = gi.cvar( "g_saberAutoBlocking", "1", CVAR_CHEAT );//must press +block button to do any blocking
g_saberRealisticCombat = gi.cvar( "g_saberMoreRealistic", "0", CVAR_CHEAT );//makes collision more precise, increases damage
debug_subdivision = gi.cvar( "debug_subdivision", "0", CVAR_CHEAT|CVAR_INIT );//debug for dismemberment
g_dismemberProbabilities = gi.cvar ( "g_dismemberProbabilities", "1", CVAR_CHEAT );//0 = ignore probabilities, 1 = use probabilities
g_saberRealisticCombat = gi.cvar( "g_saberMoreRealistic", "0", CVAR_ARCHIVE );//makes collision more precise, increases damage
debug_subdivision = gi.cvar( "debug_subdivision", "0", CVAR_ARCHIVE );//debug for dismemberment
g_dismemberProbabilities = gi.cvar ( "g_dismemberProbabilities", "1", CVAR_ARCHIVE );//0 = ignore probabilities, 1 = use probabilities
g_saberDamageCapping = gi.cvar( "g_saberDamageCapping", "1", CVAR_CHEAT );//caps damage of sabers vs players and NPC who use sabers
g_saberMoveSpeed = gi.cvar( "g_saberMoveSpeed", "1", CVAR_CHEAT );//how fast you run while attacking with a saber
g_saberAnimSpeed = gi.cvar( "g_saberAnimSpeed", "1", CVAR_CHEAT );//how fast saber animations run
@@ -2274,9 +2274,9 @@ qboolean WP_SaberDamageEffects( trace_t *tr, const vec3_t start, float length, f
}

//Get the hit location based on surface name
if ( (hitLoc[hitEntNum[numHitEnts]] == HL_NONE && trHitLoc[numHitEnts] == HL_NONE)
|| (hitDismemberLoc[hitEntNum[numHitEnts]] == HL_NONE && trDismemberLoc[numHitEnts] == HL_NONE)
|| (!hitDismember[hitEntNum[numHitEnts]] && !trDismember[numHitEnts]) )
if ( (hitLoc[numHitEnts] == HL_NONE && trHitLoc[numHitEnts] == HL_NONE)
|| (hitDismemberLoc[numHitEnts] == HL_NONE && trDismemberLoc[numHitEnts] == HL_NONE)
|| (!hitDismember[numHitEnts] && !trDismember[numHitEnts]) )
{//no hit loc set for this ent this damage cycle yet
//FIXME: find closest impact surf *first* (per ent), then call G_GetHitLocFromSurfName?
//FIXED: if hit multiple ents in this collision record, these trSurfName, trDismember and trDismemberLoc will get stomped/confused over the multiple ents I hit
@@ -583,7 +583,7 @@ void G_InitCvars( void ) {
com_buildScript = gi.cvar ("com_buildscript", "0", 0);

g_saberAutoBlocking = gi.cvar( "g_saberAutoBlocking", "1", CVAR_ARCHIVE|CVAR_CHEAT );//must press +block button to do any blocking
g_saberRealisticCombat = gi.cvar( "g_saberRealisticCombat", "0", CVAR_ARCHIVE|CVAR_CHEAT );//makes collision more precise, increases damage
g_saberRealisticCombat = gi.cvar( "g_saberRealisticCombat", "0", CVAR_ARCHIVE );//makes collision more precise, increases damage
g_saberMoveSpeed = gi.cvar( "g_saberMoveSpeed", "1", CVAR_ARCHIVE|CVAR_CHEAT );//how fast you run while attacking with a saber
g_saberAnimSpeed = gi.cvar( "g_saberAnimSpeed", "1", CVAR_ARCHIVE|CVAR_CHEAT );//how fast saber animations run
g_saberAutoAim = gi.cvar( "g_saberAutoAim", "1", CVAR_ARCHIVE|CVAR_CHEAT );//auto-aims at enemies when not moving or when just running forward
@@ -1370,9 +1370,9 @@ qboolean WP_SaberDamageEffects( trace_t *tr, const vec3_t start, float length, f
G_PlayEffect( hitEffect, coll.mCollisionPosition, coll.mCollisionNormal );

//Get the hit location based on surface name
if ( (hitLoc[hitEntNum[numHitEnts]] == HL_NONE && trHitLoc == HL_NONE)
|| (hitDismemberLoc[hitEntNum[numHitEnts]] == HL_NONE && trDismemberLoc == HL_NONE)
|| (!hitDismember[hitEntNum[numHitEnts]] && !trDismember) )
if ( (hitLoc[numHitEnts] == HL_NONE && trHitLoc == HL_NONE)
|| (hitDismemberLoc[numHitEnts] == HL_NONE && trDismemberLoc == HL_NONE)
|| (!hitDismember[numHitEnts] && !trDismember) )
{//no hit loc set for this ent this damage cycle yet
//FIXME: find closest impact surf *first* (per ent), then call G_GetHitLocFromSurfName?
trDismember = G_GetHitLocFromSurfName( &g_entities[coll.mEntityNum], gi.G2API_GetSurfaceName( &g_entities[coll.mEntityNum].ghoul2[coll.mModelIndex], coll.mSurfaceIndex ), &trHitLoc, coll.mCollisionPosition, dmgDir, bladeDir, MOD_SABER );

0 comments on commit c5fefc6

Please sign in to comment.