~ubuntu-branches/ubuntu/jaunty/openarena/jaunty

« back to all changes in this revision

Viewing changes to code/cgame/cg_weapons.c

  • Committer: Bazaar Package Importer
  • Author(s): Bruno "Fuddl" Kleinert, Bruno "Fuddl" Kleinert
  • Date: 2008-04-24 14:33:54 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080424143354-0cuxsalv98ajw2js
Tags: 0.7.6-1
[ Bruno "Fuddl" Kleinert ]
* New upstream release
* Freshen 10_fix_build_and_binary_on_alpha.dpatch to apply to latest
  upstream sources
* Remove 10-fix_menudef.h_includes.dpatch which pulled in a missing header
  file. The header is now included in the upstream tarball.
* Remove debian/watch, because upstream places its new releases too often to
  different download locations
* Updated debian/copyright to reflect the download location
* Expand copyright years in debian/copyright

Show diffs side-by-side

added added

removed removed

Lines of Context:
983
983
 
984
984
        memset( &beam, 0, sizeof( beam ) );
985
985
 
 
986
//unlagged - attack prediction #1
 
987
        // if the entity is us, unlagged is on server-side, and we've got it on for the lightning gun
 
988
        if ( (cent->currentState.number == cg.predictedPlayerState.clientNum) && cgs.delagHitscan &&
 
989
                        ( cg_delag.integer & 1 || cg_delag.integer & 8 ) ) {
 
990
                // always shoot straight forward from our current position
 
991
                AngleVectors( cg.predictedPlayerState.viewangles, forward, NULL, NULL );
 
992
                VectorCopy( cg.predictedPlayerState.origin, muzzlePoint );
 
993
        }
 
994
        else
 
995
//unlagged - attack prediction #1
 
996
 
986
997
        // CPMA  "true" lightning
987
998
        if ((cent->currentState.number == cg.predictedPlayerState.clientNum) && (cg_trueLightning.value != 0)) {
988
999
                vec3_t angle;
989
1000
                int i;
990
1001
 
 
1002
//unlagged - true lightning
 
1003
                // might as well fix up true lightning while we're at it
 
1004
                vec3_t viewangles;
 
1005
                VectorCopy( cg.predictedPlayerState.viewangles, viewangles );
 
1006
//unlagged - true lightning
 
1007
 
991
1008
                for (i = 0; i < 3; i++) {
992
1009
                        float a = cent->lerpAngles[i] - cg.refdefViewAngles[i];
993
1010
                        if (a > 180) {
1007
1024
                }
1008
1025
 
1009
1026
                AngleVectors(angle, forward, NULL, NULL );
1010
 
                VectorCopy(cent->lerpOrigin, muzzlePoint );
1011
 
//              VectorCopy(cg.refdef.vieworg, muzzlePoint );
 
1027
//unlagged - true lightning
 
1028
//              VectorCopy(cent->lerpOrigin, muzzlePoint );
 
1029
//              VectorCopy(cg.refdef.vieworg, muzzlePoint );
 
1030
                // *this* is the correct origin for true lightning
 
1031
                VectorCopy(cg.predictedPlayerState.origin, muzzlePoint );
 
1032
//unlagged - true lightning
1012
1033
        } else {
1013
1034
                // !CPMA
1014
1035
                AngleVectors( cent->lerpAngles, forward, NULL, NULL );
1471
1492
        int             x, y, w;
1472
1493
        char    *name;
1473
1494
        float   *color;
 
1495
        vec4_t  realColor; 
1474
1496
 
1475
1497
        // don't display if dead
1476
1498
        if ( cg.predictedPlayerState.stats[STAT_HEALTH] <= 0 ) {
1478
1500
        }
1479
1501
 
1480
1502
        color = CG_FadeColor( cg.weaponSelectTime, WEAPON_SELECT_TIME );
 
1503
 
 
1504
        //Elimination: Always show weapon bar
 
1505
        if(cg_alwaysWeaponBar.integer) {
 
1506
                realColor[0] = 1.0;
 
1507
                realColor[1] = 1.0;
 
1508
                realColor[2] = 1.0;
 
1509
                realColor[3] = 1.0;
 
1510
                color = realColor;
 
1511
        }
 
1512
 
1481
1513
        if ( !color ) {
1482
1514
                return;
1483
1515
        }
1695
1727
        int                             c;
1696
1728
        weaponInfo_t    *weap;
1697
1729
 
 
1730
        if((cgs.gametype == GT_ELIMINATION || cgs.gametype == GT_CTF_ELIMINATION) && cgs.roundStartTime>=cg.time)
 
1731
                return; //if we havn't started in ELIMINATION then do not fire
 
1732
 
1698
1733
        ent = &cent->currentState;
1699
1734
        if ( ent->weapon == WP_NONE ) {
1700
1735
                return;
1739
1774
        if ( weap->ejectBrassFunc && cg_brassTime.integer > 0 ) {
1740
1775
                weap->ejectBrassFunc( cent );
1741
1776
        }
 
1777
 
 
1778
//unlagged - attack prediction #1
 
1779
        CG_PredictWeaponEffects( cent );
 
1780
//unlagged - attack prediction #1
1742
1781
}
1743
1782
 
1744
1783
 
2048
2087
hit splashes
2049
2088
================
2050
2089
*/
2051
 
static void CG_ShotgunPattern( vec3_t origin, vec3_t origin2, int seed, int otherEntNum ) {
 
2090
//unlagged - attack prediction
 
2091
// made this non-static for access from cg_unlagged.c
 
2092
void CG_ShotgunPattern( vec3_t origin, vec3_t origin2, int seed, int otherEntNum ) {
2052
2093
        int                     i;
2053
2094
        float           r, u;
2054
2095
        vec3_t          end;