[iortcw] 149/152: All: Fix some indentation issues and warnings

Simon McVittie smcv at debian.org
Fri Sep 8 10:40:29 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.5a
in repository iortcw.

commit 9d5c7778685e7ba99d1e608decd158c89d7e3e9a
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Fri Nov 11 18:29:25 2016 -0500

    All: Fix some indentation issues and warnings
---
 MP/code/game/bg_pmove.c      |  27 +-
 MP/code/tools/lcc/src/dag.c  |   5 +-
 MP/code/tools/lcc/src/expr.c |  34 +-
 SP/code/game/bg_pmove.c      | 917 +++++++++++++++++++++----------------------
 SP/code/tools/lcc/src/dag.c  |   5 +-
 SP/code/tools/lcc/src/expr.c |  34 +-
 6 files changed, 505 insertions(+), 517 deletions(-)

diff --git a/MP/code/game/bg_pmove.c b/MP/code/game/bg_pmove.c
index 8eb5221..136073d 100644
--- a/MP/code/game/bg_pmove.c
+++ b/MP/code/game/bg_pmove.c
@@ -2507,8 +2507,7 @@ static void PM_Weapon( void ) {
 			}
 			return;
 		}
-	} else
-	{
+	} else {
 		pm->ps->pm_flags &= ~PMF_USE_ITEM_HELD;
 	}
 
@@ -2607,12 +2606,9 @@ static void PM_Weapon( void ) {
 				}
 			}
 		}
-// jpw
-
+		// jpw
 	}
 
-
-
 	// check for weapon change
 	// can't change if weapon is firing, but can change
 	// again if lowering or raising
@@ -2735,8 +2731,7 @@ static void PM_Weapon( void ) {
 	}
 
 	// start the animation even if out of ammo
-	switch ( pm->ps->weapon )
-	{
+	switch ( pm->ps->weapon ) {
 	default:
 		if ( !weaponstateFiring ) {
 			// delay so the weapon can get up into position before firing (and showing the flash)
@@ -2745,7 +2740,7 @@ static void PM_Weapon( void ) {
 			BG_AnimScriptEvent( pm->ps, ANIM_ET_FIREWEAPON, qfalse, qtrue );
 		}
 		break;
-		// machineguns should continue the anim, rather than start each fire
+	// machineguns should continue the anim, rather than start each fire
 	case WP_MP40:
 	case WP_THOMPSON:
 	case WP_STEN:
@@ -2796,7 +2791,7 @@ static void PM_Weapon( void ) {
 		}
 		break;
 
-		// melee
+	// melee
 	case WP_KNIFE:
 	case WP_KNIFE2:
 		if ( !delayedFire ) {
@@ -2809,7 +2804,7 @@ static void PM_Weapon( void ) {
 		}
 		break;
 
-		// throw
+	// throw
 	case WP_DYNAMITE:
 	case WP_DYNAMITE2:
 	case WP_GRENADE_LAUNCHER:
@@ -2967,7 +2962,7 @@ static void PM_Weapon( void ) {
 
 	default:
 		// RF, testing
-//			PM_ContinueWeaponAnim(weapattackanim);
+//		PM_ContinueWeaponAnim(weapattackanim);
 		PM_StartWeaponAnim( weapattackanim );
 		break;
 	}
@@ -3121,9 +3116,8 @@ static void PM_Weapon( void ) {
 		break;
 
 	default:
-	case WP_GAUNTLET:
-		switch ( pm->ps->aiChar )
-		{
+		case WP_GAUNTLET:
+		switch ( pm->ps->aiChar ) {
 		case AICHAR_LOPER:      // delay 'til next attack
 		case AICHAR_SEALOPER:
 			addTime = 1000;
@@ -3155,7 +3149,8 @@ static void PM_Weapon( void ) {
 
 	// add the recoil amount to the aimSpreadScale
 //	pm->ps->aimSpreadScale += 3.0*aimSpreadScaleAdd;
-//	if (pm->ps->aimSpreadScale > 255) pm->ps->aimSpreadScale = 255;
+//		if (pm->ps->aimSpreadScale > 255)
+//			pm->ps->aimSpreadScale = 255;
 	pm->ps->aimSpreadScaleFloat += 3.0 * aimSpreadScaleAdd;
 	if ( pm->ps->aimSpreadScaleFloat > 255 ) {
 		pm->ps->aimSpreadScaleFloat = 255;
diff --git a/MP/code/tools/lcc/src/dag.c b/MP/code/tools/lcc/src/dag.c
index 420cbe7..0f23651 100644
--- a/MP/code/tools/lcc/src/dag.c
+++ b/MP/code/tools/lcc/src/dag.c
@@ -518,8 +518,9 @@ void emitcode(void) {
 			       if (glevel > 0 && IR->stabline) {
 			       	(*IR->stabline)(&cp->u.point.src); swtoseg(CODE); } break;
 		case Gen: case Jump:
-		case Label:    if (cp->u.forest)
-			       	(*IR->emit)(cp->u.forest); break;
+		case Label:    if (cp->u.forest) {
+			       	(*IR->emit)(cp->u.forest);
+			       } break;
 		case Local:    if (glevel && IR->stabsym) {
 			       	(*IR->stabsym)(cp->u.var);
 			       	swtoseg(CODE);
diff --git a/MP/code/tools/lcc/src/expr.c b/MP/code/tools/lcc/src/expr.c
index 96eec21..e0c1aae 100644
--- a/MP/code/tools/lcc/src/expr.c
+++ b/MP/code/tools/lcc/src/expr.c
@@ -154,12 +154,13 @@ static Tree unary(void) {
 
 						  else if (isaddrop(p->op))
 						  	p->u.sym->addressed = 1;
- break;
+						  break;
 	case '+':    t = gettok(); p = unary(); p = pointer(p);
 						  if (isarith(p->type))
 						  	p = cast(p, promote(p->type));
 						  else
-						  	typeerror(ADD, p, NULL);  break;
+						  	typeerror(ADD, p, NULL);
+						  break;
 	case '-':    t = gettok(); p = unary(); p = pointer(p);
 						  if (isarith(p->type)) {
 						  	Type ty = promote(p->type);
@@ -170,18 +171,21 @@ static Tree unary(void) {
 						  	} else
 						  		p = simplify(NEG, ty, p, NULL);
 						  } else
-						  	typeerror(SUB, p, NULL); break;
+						  	typeerror(SUB, p, NULL);
+						  break;
 	case '~':    t = gettok(); p = unary(); p = pointer(p);
 						  if (isint(p->type)) {
 						  	Type ty = promote(p->type);
 						  	p = simplify(BCOM, ty, cast(p, ty), NULL);
 						  } else
-						  	typeerror(BCOM, p, NULL);  break;
+						  	typeerror(BCOM, p, NULL);
+						  break;
 	case '!':    t = gettok(); p = unary(); p = pointer(p);
 						  if (isscalar(p->type))
 						  	p = simplify(NOT, inttype, cond(p), NULL);
 						  else
-						  	typeerror(NOT, p, NULL); break;
+						  	typeerror(NOT, p, NULL);
+						  break;
 	case INCR:   t = gettok(); p = unary(); p = incr(INCR, pointer(p), consttree(1, inttype)); break;
 	case DECR:   t = gettok(); p = unary(); p = incr(DECR, pointer(p), consttree(1, inttype)); break;
 	case TYPECODE: case SIZEOF: { int op = t;
@@ -313,12 +317,13 @@ static Tree postfix(Tree p) {
 			    		q = rightkid(q);
 			    		if (isaddrop(q->op) && q->u.sym->temporary)
 			    			p = tree(RIGHT, p->type, p, NULL);
-			    	} else
-			    		error("left operand of . has incompatible type `%t'\n",
-			    			p->type);
+			    	} else {
+			    		error("left operand of . has incompatible type `%t'\n", p->type);
+			    	}
 			    	t = gettok();
-			    } else
-			    	error("field name expected\n"); break;
+			    } else {
+			    	error("field name expected\n");
+			    } break;
 		case DEREF: t = gettok();
 			    p = pointer(p);
 			    if (t == ID) {
@@ -326,12 +331,13 @@ static Tree postfix(Tree p) {
 			    		if (YYnull)
 			    			p = nullcheck(p);
 			    		p = field(p, token);
-			    	} else
+			    	} else {
 			    		error("left operand of -> has incompatible type `%t'\n", p->type);
-
+			    	}
 			    	t = gettok();
-			    } else
-			    	error("field name expected\n"); break;
+			    } else {
+			    	error("field name expected\n");
+			    } break;
 		default:
 			return p;
 		}
diff --git a/SP/code/game/bg_pmove.c b/SP/code/game/bg_pmove.c
index 6d41a8e..8f04941 100644
--- a/SP/code/game/bg_pmove.c
+++ b/SP/code/game/bg_pmove.c
@@ -2744,7 +2744,7 @@ static void PM_Weapon( void ) {
 #ifdef GAMEDLL
 	if ( g_reloading.integer )
 #endif
-	gameReloading = qtrue;
+		gameReloading = qtrue;
 	else {
 		gameReloading = qfalse;
 	}
@@ -2845,8 +2845,7 @@ static void PM_Weapon( void ) {
 			}
 			return;
 		}
-	} else
-	{
+	} else {
 		pm->ps->pm_flags &= ~PMF_USE_ITEM_HELD;
 	}
 
@@ -2865,80 +2864,79 @@ static void PM_Weapon( void ) {
 #ifdef GAMEDLL
 				if ( g_gametype.integer != GT_SINGLE_PLAYER ) {
 #endif
-				if ( pm->ps->grenadeTimeLeft < 5000 ) {
-					pm->ps->grenadeTimeLeft = 5000;
+					if ( pm->ps->grenadeTimeLeft < 5000 ) {
+						pm->ps->grenadeTimeLeft = 5000;
+					}
 				}
-			}
 // jpw
 
-			if ( pm->ps->grenadeTimeLeft > 8000 ) {
-				PM_AddEvent( EV_FIRE_WEAPON );
-				pm->ps->weaponTime = 1600;
-				PM_WeaponUseAmmo( pm->ps->weapon, 1 );      //----(SA)	take ammo
-				return;
-			}
+				if ( pm->ps->grenadeTimeLeft > 8000 ) {
+					PM_AddEvent( EV_FIRE_WEAPON );
+					pm->ps->weaponTime = 1600;
+					PM_WeaponUseAmmo( pm->ps->weapon, 1 );      //----(SA)	take ammo
+					return;
+				}
 
 //				Com_Printf("Dynamite Timer: %d\n", pm->ps->grenadeTimeLeft);
-		} else {
-			pm->ps->grenadeTimeLeft -= pml.msec;
+			} else {
+				pm->ps->grenadeTimeLeft -= pml.msec;
 //				Com_Printf("Grenade Timer: %d\n", pm->ps->grenadeTimeLeft);
 
-			if ( pm->ps->grenadeTimeLeft <= 0 ) {   // give two frames advance notice so there's time to launch and detonate
+				if ( pm->ps->grenadeTimeLeft <= 0 ) {   // give two frames advance notice so there's time to launch and detonate
 //					pm->ps->grenadeTimeLeft = 100;
 //					PM_AddEvent( EV_FIRE_WEAPON );
-				PM_WeaponUseAmmo( pm->ps->weapon, 1 );      //----(SA)	take ammo
+					PM_WeaponUseAmmo( pm->ps->weapon, 1 );      //----(SA)	take ammo
 //					pm->ps->weaponTime = 1600;
 
-				PM_AddEvent( EV_GRENADE_SUICIDE );      //----(SA)	die, dumbass
+					PM_AddEvent( EV_GRENADE_SUICIDE );      //----(SA)	die, dumbass
 
-				return;
+					return;
+				}
 			}
-		}
 
-		if ( !( pm->cmd.buttons & BUTTON_ATTACK ) ) { //----(SA)	modified
-			if ( pm->ps->weaponDelay == ammoTable[pm->ps->weapon].fireDelayTime ) {
-				// released fire button.  Fire!!!
-				BG_AnimScriptEvent( pm->ps, ANIM_ET_FIREWEAPON, qfalse, qtrue );
+			if ( !( pm->cmd.buttons & BUTTON_ATTACK ) ) { //----(SA)	modified
+				if ( pm->ps->weaponDelay == ammoTable[pm->ps->weapon].fireDelayTime ) {
+					// released fire button.  Fire!!!
+					BG_AnimScriptEvent( pm->ps, ANIM_ET_FIREWEAPON, qfalse, qtrue );
+				}
+			} else {
+				return;
 			}
-		} else {
-			return;
 		}
 	}
-}
 
-if ( pm->ps->weaponDelay > 0 ) {
-	pm->ps->weaponDelay -= pml.msec;
-	if ( pm->ps->weaponDelay <= 0 ) {
-		pm->ps->weaponDelay = 0;
-		delayedFire = qtrue;            // weapon delay has expired.  Fire this frame
+	if ( pm->ps->weaponDelay > 0 ) {
+		pm->ps->weaponDelay -= pml.msec;
+		if ( pm->ps->weaponDelay <= 0 ) {
+			pm->ps->weaponDelay = 0;
+			delayedFire = qtrue;            // weapon delay has expired.  Fire this frame
 
-		// double check the player is still holding the fire button down for these weapons
-		// so you don't get a delayed "non-fire" (fire hit and released, then shot fires)
-		switch ( pm->ps->weapon ) {
-		case WP_VENOM:
-			if ( pm->ps->weaponstate == WEAPON_FIRING ) {
-				delayedFire = qfalse;
+			// double check the player is still holding the fire button down for these weapons
+			// so you don't get a delayed "non-fire" (fire hit and released, then shot fires)
+			switch ( pm->ps->weapon ) {
+			case WP_VENOM:
+				if ( pm->ps->weaponstate == WEAPON_FIRING ) {
+					delayedFire = qfalse;
+				}
+				break;
+			default:
+				break;
 			}
-			break;
-		default:
-			break;
 		}
 	}
-}
 
-
-if ( pm->ps->weaponstate == WEAPON_RELAXING ) {
-	pm->ps->weaponstate = WEAPON_READY;
-	return;
-}
-
-// make weapon function
-if ( pm->ps->weaponTime > 0 ) {
-	pm->ps->weaponTime -= pml.msec;
-	if ( pm->ps->weaponTime < 0 ) {
-		pm->ps->weaponTime = 0;
+	if ( pm->ps->weaponstate == WEAPON_RELAXING ) {
+		pm->ps->weaponstate = WEAPON_READY;
+		return;
 	}
 
+	// make weapon function
+	if ( pm->ps->weaponTime > 0 ) {
+		pm->ps->weaponTime -= pml.msec;
+		if ( pm->ps->weaponTime < 0 ) {
+			pm->ps->weaponTime = 0;
+		}
+
 //----(SA)	removed for DM and id
 /*
 		// RF, testing special case Pistol, which fires faster if you tap the fire button
@@ -2977,542 +2975,523 @@ if ( pm->ps->weaponTime > 0 ) {
 #ifdef GAMEDLL
 	if ( g_gametype.integer != GT_SINGLE_PLAYER ) {
 #endif
-	if ( pm->ps->weapon == WP_LUGER ) {
-		if ( pm->ps->releasedFire ) {
-			if ( pm->ps->weaponTime <= 150 && ( pm->cmd.buttons & BUTTON_ATTACK ) ) {
-				pm->ps->weaponTime = 0;
+		if ( pm->ps->weapon == WP_LUGER ) {
+			if ( pm->ps->releasedFire ) {
+				if ( pm->ps->weaponTime <= 150 && ( pm->cmd.buttons & BUTTON_ATTACK ) ) {
+					pm->ps->weaponTime = 0;
+				}
+			} else if ( !( pm->cmd.buttons & BUTTON_ATTACK ) && ( pm->ps->weaponTime >= 50 ) ) {
+				pm->ps->releasedFire = qtrue;
 			}
-		} else if ( !( pm->cmd.buttons & BUTTON_ATTACK ) && ( pm->ps->weaponTime >= 50 ) ) {
-			pm->ps->releasedFire = qtrue;
-		}
-	} else if ( pm->ps->weapon == WP_COLT ) {
-		if ( pm->ps->releasedFire ) {
-			if ( pm->ps->weaponTime <= 150 && ( pm->cmd.buttons & BUTTON_ATTACK ) ) {
-				pm->ps->weaponTime = 0;
+		} else if ( pm->ps->weapon == WP_COLT ) {
+			if ( pm->ps->releasedFire ) {
+				if ( pm->ps->weaponTime <= 150 && ( pm->cmd.buttons & BUTTON_ATTACK ) ) {
+					pm->ps->weaponTime = 0;
+				}
+			} else if ( !( pm->cmd.buttons & BUTTON_ATTACK ) && ( pm->ps->weaponTime >= 100 ) ) {
+				pm->ps->releasedFire = qtrue;
 			}
-		} else if ( !( pm->cmd.buttons & BUTTON_ATTACK ) && ( pm->ps->weaponTime >= 100 ) ) {
-			pm->ps->releasedFire = qtrue;
 		}
 	}
-}
 // jpw
 
 }
 
+	// check for weapon change
+	// can't change if weapon is firing, but can change
+	// again if lowering or raising
 
-// check for weapon change
-// can't change if weapon is firing, but can change
-// again if lowering or raising
-
-// TTimo gcc: suggest parentheses around && within ||
-if ( pm->ps->weaponTime <= 0 || ( !weaponstateFiring && pm->ps->weaponDelay <= 0 ) ) {
-	if ( pm->ps->weapon != pm->cmd.weapon ) {
-		PM_BeginWeaponChange( pm->ps->weapon, pm->cmd.weapon, qfalse );     //----(SA)	modified
+	// TTimo gcc: suggest parentheses around && within ||
+	if ( pm->ps->weaponTime <= 0 || ( !weaponstateFiring && pm->ps->weaponDelay <= 0 ) ) {
+		if ( pm->ps->weapon != pm->cmd.weapon ) {
+			PM_BeginWeaponChange( pm->ps->weapon, pm->cmd.weapon, qfalse );     //----(SA)	modified
+		}
 	}
-}
 
-// check for clip change
-PM_CheckForReload( pm->ps->weapon );
+	// check for clip change
+	PM_CheckForReload( pm->ps->weapon );
 
-if ( pm->ps->weaponTime > 0 || pm->ps->weaponDelay > 0 ) {
-	return;
-}
-
-if ( pm->ps->weaponstate == WEAPON_RELOADING ) {
-	PM_FinishWeaponReload();
-}
+	if ( pm->ps->weaponTime > 0 || pm->ps->weaponDelay > 0 ) {
+		return;
+	}
 
-// change weapon if time
-if ( pm->ps->weaponstate == WEAPON_DROPPING || pm->ps->weaponstate == WEAPON_DROPPING_TORELOAD ) {
-	PM_FinishWeaponChange();
-	return;
-}
+	if ( pm->ps->weaponstate == WEAPON_RELOADING ) {
+		PM_FinishWeaponReload();
+	}
 
-if ( pm->ps->weaponstate == WEAPON_RAISING ) {
-	pm->ps->weaponstate = WEAPON_READY;
-	PM_StartWeaponAnim( WEAP_IDLE1 );
-	return;
-} else if ( pm->ps->weaponstate == WEAPON_RAISING_TORELOAD ) {
-	pm->ps->weaponstate = WEAPON_READY;     // need to switch to READY so the reload will work
-	PM_BeginWeaponReload( pm->ps->weapon );
-	return;
-}
+	// change weapon if time
+	if ( pm->ps->weaponstate == WEAPON_DROPPING || pm->ps->weaponstate == WEAPON_DROPPING_TORELOAD ) {
+		PM_FinishWeaponChange();
+		return;
+	}
 
+	if ( pm->ps->weaponstate == WEAPON_RAISING ) {
+		pm->ps->weaponstate = WEAPON_READY;
+		PM_StartWeaponAnim( WEAP_IDLE1 );
+		return;
+	} else if ( pm->ps->weaponstate == WEAPON_RAISING_TORELOAD ) {
+		pm->ps->weaponstate = WEAPON_READY;     // need to switch to READY so the reload will work
+		PM_BeginWeaponReload( pm->ps->weapon );
+		return;
+	}
 
-if ( pm->ps->weapon == WP_NONE ) {  // this is possible since the player starts with nothing
-	return;
-}
+	if ( pm->ps->weapon == WP_NONE ) {  // this is possible since the player starts with nothing
+		return;
+	}
 
 
 // JPW NERVE -- in multiplayer, don't allow panzerfaust or dynamite to fire if charge bar isn't full
 #ifdef GAMEDLL
-if ( g_gametype.integer == GT_WOLF ) {
-	if ( pm->ps->weapon == WP_PANZERFAUST ) {
-		if ( pm->cmd.serverTime - pm->ps->classWeaponTime < g_soldierChargeTime.integer ) {
-			return;
+	if ( g_gametype.integer == GT_WOLF ) {
+		if ( pm->ps->weapon == WP_PANZERFAUST ) {
+			if ( pm->cmd.serverTime - pm->ps->classWeaponTime < g_soldierChargeTime.integer ) {
+				return;
+			}
 		}
-	}
-	if ( pm->ps->weapon == WP_DYNAMITE ) {
-		if ( pm->cmd.serverTime - pm->ps->classWeaponTime < g_engineerChargeTime.integer ) {        // had to use multiplier because chargetime is used elsewhere as bomb diffuse time FIXME not really but NOTE changing bomb diffuse time will require changing this time as well (intended function: new charge ready when old one explodes, ie every 30 seconds or so)
+		if ( pm->ps->weapon == WP_DYNAMITE ) {
+			if ( pm->cmd.serverTime - pm->ps->classWeaponTime < g_engineerChargeTime.integer ) {        // had to use multiplier because chargetime is used elsewhere as bomb diffuse time FIXME not really but NOTE changing bomb diffuse time will require changing this time as well (intended function: new charge ready when old one explodes, ie every 30 seconds or so)
 
-			return;
+				return;
+			}
 		}
 	}
-}
 #endif
 #ifdef CGAMEDLL
-if ( cg_gameType.integer == GT_WOLF ) {
-	if ( pm->ps->weapon == WP_PANZERFAUST ) {
-		if ( pm->cmd.serverTime - pm->ps->classWeaponTime < cg_soldierChargeTime.integer ) {
-			return;
+	if ( cg_gameType.integer == GT_WOLF ) {
+		if ( pm->ps->weapon == WP_PANZERFAUST ) {
+			if ( pm->cmd.serverTime - pm->ps->classWeaponTime < cg_soldierChargeTime.integer ) {
+				return;
+			}
 		}
-	}
-	if ( pm->ps->weapon == WP_DYNAMITE ) {
-		if ( pm->cmd.serverTime - pm->ps->classWeaponTime < cg_engineerChargeTime.integer ) {
-			return;
+		if ( pm->ps->weapon == WP_DYNAMITE ) {
+			if ( pm->cmd.serverTime - pm->ps->classWeaponTime < cg_engineerChargeTime.integer ) {
+				return;
+			}
 		}
 	}
-}
 #endif
 // jpw
 
-// check for fire
-if ( !( pm->cmd.buttons & ( BUTTON_ATTACK | WBUTTON_ATTACK2 ) ) && !delayedFire ) {     // if not on fire button and there's not a delayed shot this frame...
-	pm->ps->weaponTime  = 0;
-	pm->ps->weaponDelay = 0;
-
-	if ( weaponstateFiring ) {  // you were just firing, time to relax
-		PM_ContinueWeaponAnim( WEAP_IDLE1 );
-	}
-
-	pm->ps->weaponstate = WEAPON_READY;
-	return;
-}
+	// check for fire
+	if ( !( pm->cmd.buttons & ( BUTTON_ATTACK | WBUTTON_ATTACK2 ) ) && !delayedFire ) {     // if not on fire button and there's not a delayed shot this frame...
+		pm->ps->weaponTime  = 0;
+		pm->ps->weaponDelay = 0;
 
+		if ( weaponstateFiring ) {  // you were just firing, time to relax
+			PM_ContinueWeaponAnim( WEAP_IDLE1 );
+		}
 
-if ( gameReloading ) {
-	return;
-}
+		pm->ps->weaponstate = WEAPON_READY;
+		return;
+	}
 
-// player is zooming - no fire
-if ( pm->ps->eFlags & EF_ZOOMING ) {
-	return;
-}
+	if ( gameReloading ) {
+		return;
+	}
 
-// player is leaning - no fire
-if ( pm->ps->leanf != 0 && pm->ps->weapon != WP_GRENADE_LAUNCHER && pm->ps->weapon != WP_GRENADE_PINEAPPLE && pm->ps->weapon != WP_DYNAMITE ) {
-	return;
-}
+	// player is zooming - no fire
+	if ( pm->ps->eFlags & EF_ZOOMING ) {
+		return;
+	}
 
-// player is underwater - no fire
-if ( pm->waterlevel == 3 ) {
-	if ( pm->ps->weapon != WP_KNIFE &&
-		 pm->ps->weapon != WP_GRENADE_LAUNCHER &&
-		 pm->ps->weapon != WP_GRENADE_PINEAPPLE ) {
-		PM_AddEvent( EV_NOFIRE_UNDERWATER );        // event for underwater 'click' for nofire
-		pm->ps->weaponTime  = 500;
+	// player is leaning - no fire
+	if ( pm->ps->leanf != 0 && pm->ps->weapon != WP_GRENADE_LAUNCHER && pm->ps->weapon != WP_GRENADE_PINEAPPLE && pm->ps->weapon != WP_DYNAMITE ) {
 		return;
 	}
-}
 
-// start the animation even if out of ammo
-switch ( pm->ps->weapon )
-{
-default:
-	if ( !weaponstateFiring ) {
-		pm->ps->weaponDelay = ammoTable[pm->ps->weapon].fireDelayTime;          // delay so the weapon can get up into position before firing (and showing the flash)
-	} else {
-		BG_AnimScriptEvent( pm->ps, ANIM_ET_FIREWEAPON, qfalse, qtrue );
+	// player is underwater - no fire
+	if ( pm->waterlevel == 3 ) {
+		if ( pm->ps->weapon != WP_KNIFE &&
+			 pm->ps->weapon != WP_GRENADE_LAUNCHER &&
+			 pm->ps->weapon != WP_GRENADE_PINEAPPLE ) {
+			PM_AddEvent( EV_NOFIRE_UNDERWATER );        // event for underwater 'click' for nofire
+			pm->ps->weaponTime  = 500;
+			return;
+		}
 	}
-	break;
-	// machineguns should continue the anim, rather than start each fire
-case WP_MP40:
-case WP_THOMPSON:
-case WP_STEN:
-case WP_VENOM:
-case WP_FG42:
-case WP_FG42SCOPE:
-	if ( !weaponstateFiring ) {
-		if ( pm->ps->aiChar && pm->ps->weapon == WP_VENOM ) {
-			// AI get fast spin-up
-			pm->ps->weaponDelay = 150;
+
+	// start the animation even if out of ammo
+	switch ( pm->ps->weapon ) {
+	default:
+		if ( !weaponstateFiring ) {
+			// delay so the weapon can get up into position before firing (and showing the flash)
+			pm->ps->weaponDelay = ammoTable[pm->ps->weapon].fireDelayTime;
 		} else {
-			pm->ps->weaponDelay = ammoTable[pm->ps->weapon].fireDelayTime;          // delay so the weapon can get up into position before firing (and showing the flash)
+			BG_AnimScriptEvent( pm->ps, ANIM_ET_FIREWEAPON, qfalse, qtrue );
 		}
-	} else {
-		BG_AnimScriptEvent( pm->ps, ANIM_ET_FIREWEAPON, qtrue, qtrue );
-	}
-	break;
-case WP_PANZERFAUST:
-case WP_SILENCER:
-case WP_LUGER:
-case WP_COLT:
-case WP_AKIMBO:         //----(SA)	added
-case WP_SNIPERRIFLE:
-case WP_SNOOPERSCOPE:
-case WP_MAUSER:
-case WP_GARAND:
-	if ( !weaponstateFiring ) {
-		// NERVE's panzerfaust spinup
-//				if (pm->ps->weapon == WP_PANZERFAUST)
-//					PM_AddEvent( EV_SPINUP );
-		pm->ps->weaponDelay = ammoTable[pm->ps->weapon].fireDelayTime;
-	} else {
-		BG_AnimScriptEvent( pm->ps, ANIM_ET_FIREWEAPON, qfalse, qtrue );
-	}
-	break;
-// melee
-case WP_KNIFE:
-	if ( !delayedFire ) {
-		BG_AnimScriptEvent( pm->ps, ANIM_ET_FIREWEAPON, qfalse, qfalse );
-	}
-	break;
-case WP_GAUNTLET:
-	if ( !delayedFire ) {
-		BG_AnimScriptEvent( pm->ps, ANIM_ET_FIREWEAPON, qfalse, qfalse );
-	}
-	break;
-// throw
-case WP_DYNAMITE:
-case WP_GRENADE_LAUNCHER:
-case WP_GRENADE_PINEAPPLE:
-	if ( !delayedFire ) {
-		if ( pm->ps->aiChar ) {         // ai characters go into their regular animation setup
+		break;
+	// machineguns should continue the anim, rather than start each fire
+	case WP_MP40:
+	case WP_THOMPSON:
+	case WP_STEN:
+	case WP_VENOM:
+	case WP_FG42:
+	case WP_FG42SCOPE:
+		if ( !weaponstateFiring ) {
+			if ( pm->ps->aiChar && pm->ps->weapon == WP_VENOM ) {
+				// AI get fast spin-up
+				pm->ps->weaponDelay = 150;
+			} else {
+				// delay so the weapon can get up into position before firing (and showing the flash)
+				pm->ps->weaponDelay = ammoTable[pm->ps->weapon].fireDelayTime;
+			}
+		} else {
 			BG_AnimScriptEvent( pm->ps, ANIM_ET_FIREWEAPON, qtrue, qtrue );
-		} else {                    // the player pulls the fuse and holds the hot potato
-			if ( PM_WeaponAmmoAvailable( pm->ps->weapon ) ) {
-				if ( pm->ps->weapon == WP_DYNAMITE ) {
-					pm->ps->grenadeTimeLeft = 50;
-				} else {
-					pm->ps->grenadeTimeLeft = 4000;         // start at four seconds and count down
-
+		}
+		break;
+	case WP_PANZERFAUST:
+	case WP_SILENCER:
+	case WP_LUGER:
+	case WP_COLT:
+	case WP_AKIMBO:         //----(SA)	added
+	case WP_SNIPERRIFLE:
+	case WP_SNOOPERSCOPE:
+	case WP_MAUSER:
+	case WP_GARAND:
+		if ( !weaponstateFiring ) {
+			// NERVE's panzerfaust spinup
+//			if (pm->ps->weapon == WP_PANZERFAUST)
+//				PM_AddEvent( EV_SPINUP );
+			pm->ps->weaponDelay = ammoTable[pm->ps->weapon].fireDelayTime;
+		} else {
+			BG_AnimScriptEvent( pm->ps, ANIM_ET_FIREWEAPON, qfalse, qtrue );
+		}
+		break;
+	// melee
+	case WP_KNIFE:
+		if ( !delayedFire ) {
+			BG_AnimScriptEvent( pm->ps, ANIM_ET_FIREWEAPON, qfalse, qfalse );
+		}
+		break;
+	case WP_GAUNTLET:
+		if ( !delayedFire ) {
+			BG_AnimScriptEvent( pm->ps, ANIM_ET_FIREWEAPON, qfalse, qfalse );
+		}
+		break;
+	// throw
+	case WP_DYNAMITE:
+	case WP_GRENADE_LAUNCHER:
+	case WP_GRENADE_PINEAPPLE:
+		if ( !delayedFire ) {
+			if ( pm->ps->aiChar ) {
+				// ai characters go into their regular animation setup
+				BG_AnimScriptEvent( pm->ps, ANIM_ET_FIREWEAPON, qtrue, qtrue );
+			} else {
+				// the player pulls the fuse and holds the hot potato
+				if ( PM_WeaponAmmoAvailable( pm->ps->weapon ) ) {
+					if ( pm->ps->weapon == WP_DYNAMITE ) {
+						pm->ps->grenadeTimeLeft = 50;
+					} else {
+						// start at four seconds and count down
+						pm->ps->grenadeTimeLeft = 4000;
+					}
+					PM_StartWeaponAnim( WEAP_ATTACK1 );
 				}
-				PM_StartWeaponAnim( WEAP_ATTACK1 );
 			}
-		}
 
-		pm->ps->weaponDelay = ammoTable[pm->ps->weapon].fireDelayTime;
+			pm->ps->weaponDelay = ammoTable[pm->ps->weapon].fireDelayTime;
 
+		}
+		break;
 	}
-	break;
-}
-
-pm->ps->weaponstate = WEAPON_FIRING;
-
-
 
-// check for out of ammo
+	pm->ps->weaponstate = WEAPON_FIRING;
 
-ammoNeeded = ammoTable[pm->ps->weapon].uses;
+	// check for out of ammo
+	ammoNeeded = ammoTable[pm->ps->weapon].uses;
 
-if ( pm->ps->weapon ) {
-	int ammoAvailable;
-	qboolean reloadingW, playswitchsound = qtrue;
+	if ( pm->ps->weapon ) {
+		int ammoAvailable;
+		qboolean reloadingW, playswitchsound = qtrue;
 
-	ammoAvailable = PM_WeaponAmmoAvailable( pm->ps->weapon );
+		ammoAvailable = PM_WeaponAmmoAvailable( pm->ps->weapon );
 
-	if ( ammoNeeded > ammoAvailable ) {
+		if ( ammoNeeded > ammoAvailable ) {
 
-		reloadingW = (qboolean)( ammoNeeded <= pm->ps->ammo[ BG_FindAmmoForWeapon( pm->ps->weapon )] ); // you have ammo for this, just not in the clip
+			// you have ammo for this, just not in the clip
+			reloadingW = (qboolean)( ammoNeeded <= pm->ps->ammo[ BG_FindAmmoForWeapon( pm->ps->weapon )] );
 
-		if ( pm->ps->eFlags & EF_MELEE_ACTIVE ) {   // not going to be allowed to reload if holding a chair
-			reloadingW = qfalse;
-		}
+			if ( pm->ps->eFlags & EF_MELEE_ACTIVE ) {
+				// not going to be allowed to reload if holding a chair
+				reloadingW = qfalse;
+			}
 
-		if ( pm->ps->weapon == WP_SNOOPERSCOPE ) {
-			reloadingW = qfalse;
-		}
+			if ( pm->ps->weapon == WP_SNOOPERSCOPE ) {
+				reloadingW = qfalse;
+			}
 
-		switch ( pm->ps->weapon ) {
+			switch ( pm->ps->weapon ) {
 			// Ridah, only play if using a triggered weapon
-		case WP_GAUNTLET:
-		case WP_MONSTER_ATTACK1:
-		case WP_DYNAMITE:
-		case WP_GRENADE_LAUNCHER:
-		case WP_GRENADE_PINEAPPLE:
-			playswitchsound = qfalse;
-			break;
-
+			case WP_GAUNTLET:
+			case WP_MONSTER_ATTACK1:
+			case WP_DYNAMITE:
+			case WP_GRENADE_LAUNCHER:
+			case WP_GRENADE_PINEAPPLE:
+				playswitchsound = qfalse;
+				break;
 			// some weapons not allowed to reload.  must switch back to primary first
-		case WP_SNOOPERSCOPE:
-		case WP_SNIPERRIFLE:
-		case WP_FG42SCOPE:
-			reloadingW = qfalse;
-			break;
-		}
+			case WP_SNOOPERSCOPE:
+			case WP_SNIPERRIFLE:
+			case WP_FG42SCOPE:
+				reloadingW = qfalse;
+				break;
+			}
+
+			if ( playswitchsound ) {
+				if ( reloadingW ) {
+					PM_AddEvent( EV_EMPTYCLIP );
+				} else {
+					PM_AddEvent( EV_NOAMMO );
+				}
+			}
 
-		if ( playswitchsound ) {
 			if ( reloadingW ) {
-				PM_AddEvent( EV_EMPTYCLIP );
+				PM_ContinueWeaponAnim( WEAP_RELOAD1 );      //----(SA)
 			} else {
-				PM_AddEvent( EV_NOAMMO );
+				PM_ContinueWeaponAnim( WEAP_IDLE1 );
+				pm->ps->weaponTime += 500;
 			}
-		}
 
-		if ( reloadingW ) {
-			PM_ContinueWeaponAnim( WEAP_RELOAD1 );      //----(SA)
-		} else {
-			PM_ContinueWeaponAnim( WEAP_IDLE1 );
-			pm->ps->weaponTime += 500;
+			return;
 		}
+	}
 
+	if ( pm->ps->weaponDelay > 0 ) {
+		// if it hits here, the 'fire' has just been hit and the weapon dictated a delay.
+		// animations have been started, weaponstate has been set, but no weapon events yet. (except possibly EV_NOAMMO)
+		// checks for delayed weapons that have already been fired are return'ed above.
 		return;
 	}
-}
-
-if ( pm->ps->weaponDelay > 0 ) {
-	// if it hits here, the 'fire' has just been hit and the weapon dictated a delay.
-	// animations have been started, weaponstate has been set, but no weapon events yet. (except possibly EV_NOAMMO)
-	// checks for delayed weapons that have already been fired are return'ed above.
-	return;
-}
 
 
-// take an ammo away if not infinite
-if ( PM_WeaponAmmoAvailable( pm->ps->weapon ) != -1 ) {
-	// Rafael - check for being mounted on mg42
-	if ( !( pm->ps->persistant[PERS_HWEAPON_USE] ) ) {
-		PM_WeaponUseAmmo( pm->ps->weapon, ammoNeeded );
+	// take an ammo away if not infinite
+	if ( PM_WeaponAmmoAvailable( pm->ps->weapon ) != -1 ) {
+		// Rafael - check for being mounted on mg42
+		if ( !( pm->ps->persistant[PERS_HWEAPON_USE] ) ) {
+			PM_WeaponUseAmmo( pm->ps->weapon, ammoNeeded );
+		}
 	}
-}
 
 
-// fire weapon
+	// fire weapon
 
-// add weapon heat
-if ( ammoTable[pm->ps->weapon].maxHeat ) {
-	pm->ps->weapHeat[pm->ps->weapon] += ammoTable[pm->ps->weapon].nextShotTime;
-}
+	// add weapon heat
+	if ( ammoTable[pm->ps->weapon].maxHeat ) {
+		pm->ps->weapHeat[pm->ps->weapon] += ammoTable[pm->ps->weapon].nextShotTime;
+	}
 
-// first person weapon animations
+	// first person weapon animations
 
-// if this was the last round in the clip, play the 'lastshot' animation
-// this animation has the weapon in a "ready to reload" state
-if ( pm->ps->weapon == WP_AKIMBO ) {
-	if ( akimboFire ) {
-		weapattackanim = WEAP_ATTACK1;      // attack1 is right hand
-	} else {
-		weapattackanim = WEAP_ATTACK2;      // attack2 is left hand
-	}
-} else {
-	if ( PM_WeaponClipEmpty( pm->ps->weapon ) ) {
-		weapattackanim = WEAP_ATTACK_LASTSHOT;
+	// if this was the last round in the clip, play the 'lastshot' animation
+	// this animation has the weapon in a "ready to reload" state
+	if ( pm->ps->weapon == WP_AKIMBO ) {
+		if ( akimboFire ) {
+			weapattackanim = WEAP_ATTACK1;      // attack1 is right hand
+		} else {
+			weapattackanim = WEAP_ATTACK2;      // attack2 is left hand
+		}
 	} else {
-		weapattackanim = WEAP_ATTACK1;
+		if ( PM_WeaponClipEmpty( pm->ps->weapon ) ) {
+			weapattackanim = WEAP_ATTACK_LASTSHOT;
+		} else {
+			weapattackanim = WEAP_ATTACK1;
+		}
 	}
-}
 
-switch ( pm->ps->weapon ) {
-case WP_MAUSER:
-case WP_GRENADE_LAUNCHER:
-case WP_GRENADE_PINEAPPLE:
-case WP_DYNAMITE:
-	PM_StartWeaponAnim( weapattackanim );
-	break;
-
-case WP_VENOM:
-case WP_MP40:
-case WP_THOMPSON:
-case WP_STEN:
-	PM_ContinueWeaponAnim( weapattackanim );
-	break;
-
-default:
-	// RF, testing
-//			PM_ContinueWeaponAnim(weapattackanim);
-	PM_StartWeaponAnim( weapattackanim );
-	break;
-}
+	switch ( pm->ps->weapon ) {
+	case WP_MAUSER:
+	case WP_GRENADE_LAUNCHER:
+	case WP_GRENADE_PINEAPPLE:
+	case WP_DYNAMITE:
+		PM_StartWeaponAnim( weapattackanim );
+		break;
+	case WP_VENOM:
+	case WP_MP40:
+	case WP_THOMPSON:
+	case WP_STEN:
+		PM_ContinueWeaponAnim( weapattackanim );
+		break;
 
+	default:
+// RF, testing
+//		PM_ContinueWeaponAnim(weapattackanim);
+		PM_StartWeaponAnim( weapattackanim );
+		break;
+	}
 
 
-if ( pm->ps->weapon == WP_AKIMBO ) {
-	if ( pm->ps->weapon == WP_AKIMBO && !akimboFire ) {
-		PM_AddEvent( EV_FIRE_WEAPONB );     // really firing colt
-	} else {
-		PM_AddEvent( EV_FIRE_WEAPON );
-	}
-} else {
-	if ( PM_WeaponClipEmpty( pm->ps->weapon ) ) {
-		PM_AddEvent( EV_FIRE_WEAPON_LASTSHOT );
+
+	if ( pm->ps->weapon == WP_AKIMBO ) {
+		if ( pm->ps->weapon == WP_AKIMBO && !akimboFire ) {
+			PM_AddEvent( EV_FIRE_WEAPONB );     // really firing colt
+		} else {
+			PM_AddEvent( EV_FIRE_WEAPON );
+		}
 	} else {
-		PM_AddEvent( EV_FIRE_WEAPON );
+		if ( PM_WeaponClipEmpty( pm->ps->weapon ) ) {
+			PM_AddEvent( EV_FIRE_WEAPON_LASTSHOT );
+		} else {
+			PM_AddEvent( EV_FIRE_WEAPON );
+		}
 	}
-}
-
-
 // RF
-pm->ps->releasedFire = qfalse;
-pm->ps->lastFireTime = pm->cmd.serverTime;
+	pm->ps->releasedFire = qfalse;
+	pm->ps->lastFireTime = pm->cmd.serverTime;
 
 
-aimSpreadScaleAdd = 0;
-
-switch ( pm->ps->weapon ) {
-case WP_KNIFE:
-case WP_DYNAMITE:
-case WP_GRENADE_LAUNCHER:
-case WP_GRENADE_PINEAPPLE:
-case WP_FLAMETHROWER:
-	addTime = ammoTable[pm->ps->weapon].nextShotTime;
-	break;
-
-case WP_PANZERFAUST:
-	addTime = ammoTable[pm->ps->weapon].nextShotTime;
-	aimSpreadScaleAdd = 30;
-	break;
-
-case WP_LUGER:
-	addTime = ammoTable[pm->ps->weapon].nextShotTime;
-	aimSpreadScaleAdd = 35;
-	break;
-
-case WP_COLT:
-	addTime = ammoTable[pm->ps->weapon].nextShotTime;
-	aimSpreadScaleAdd = 20;
-	break;
+	aimSpreadScaleAdd = 0;
 
+	switch ( pm->ps->weapon ) {
+	case WP_KNIFE:
+	case WP_DYNAMITE:
+	case WP_GRENADE_LAUNCHER:
+	case WP_GRENADE_PINEAPPLE:
+	case WP_FLAMETHROWER:
+		addTime = ammoTable[pm->ps->weapon].nextShotTime;
+		break;
+	case WP_PANZERFAUST:
+		addTime = ammoTable[pm->ps->weapon].nextShotTime;
+		aimSpreadScaleAdd = 30;
+		break;
+	case WP_LUGER:
+		addTime = ammoTable[pm->ps->weapon].nextShotTime;
+		aimSpreadScaleAdd = 35;
+		break;
+	case WP_COLT:
+		addTime = ammoTable[pm->ps->weapon].nextShotTime;
+		aimSpreadScaleAdd = 20;
+		break;
 //----(SA)	added
-case WP_AKIMBO:
-	// if you're firing an akimbo colt, and your other gun is dry,
-	// nextshot needs to take 2x time
-
-	addTime = ammoTable[pm->ps->weapon].nextShotTime;
-
-	// (SA) (added check for last shot in both guns so there's no delay for the last shot)
-	if ( !pm->ps->ammoclip[WP_AKIMBO] || !pm->ps->ammoclip[WP_COLT] ) {
-		if ( ( !pm->ps->ammoclip[WP_AKIMBO] && !akimboFire ) || ( !pm->ps->ammoclip[WP_COLT] && akimboFire ) ) {
-			addTime = 2 * ammoTable[pm->ps->weapon].nextShotTime;
+	case WP_AKIMBO:
+		// if you're firing an akimbo colt, and your other gun is dry,
+		// nextshot needs to take 2x time
+		addTime = ammoTable[pm->ps->weapon].nextShotTime;
+
+		// (SA) (added check for last shot in both guns so there's no delay for the last shot)
+		if ( !pm->ps->ammoclip[WP_AKIMBO] || !pm->ps->ammoclip[WP_COLT] ) {
+			if ( ( !pm->ps->ammoclip[WP_AKIMBO] && !akimboFire ) || ( !pm->ps->ammoclip[WP_COLT] && akimboFire ) ) {
+				addTime = 2 * ammoTable[pm->ps->weapon].nextShotTime;
+			}
 		}
-	}
 
-	aimSpreadScaleAdd = 20;
-	break;
+		aimSpreadScaleAdd = 20;
+		break;
 //----(SA)	end
-
-case WP_MAUSER:
-case WP_GARAND:
-	addTime = ammoTable[pm->ps->weapon].nextShotTime;
-	aimSpreadScaleAdd = 50;
-	break;
-
-case WP_SNIPERRIFLE:        // (SA) not so much added per shot.  these weapons mostly uses player movement to get out of whack
-	addTime = ammoTable[pm->ps->weapon].nextShotTime;
+	case WP_MAUSER:
+	case WP_GARAND:
+		addTime = ammoTable[pm->ps->weapon].nextShotTime;
+		aimSpreadScaleAdd = 50;
+		break;
+	case WP_SNIPERRIFLE:
+		// (SA) not so much added per shot.  these weapons mostly uses player movement to get out of whack
+		addTime = ammoTable[pm->ps->weapon].nextShotTime;
 // JPW NERVE crippling the rifle a bit in multiplayer; it's way too strong so make it go completely out every time you fire
 #ifdef CGAMEDLL
-	if ( cg_gameType.integer != GT_SINGLE_PLAYER ) {
+		if ( cg_gameType.integer != GT_SINGLE_PLAYER ) {
 #endif
 #ifdef GAMEDLL
-	if ( g_gametype.integer != GT_SINGLE_PLAYER ) {
+		if ( g_gametype.integer != GT_SINGLE_PLAYER ) {
 #endif
 //			addTime *= 2; // pulled this and reduced rifle damage
-	aimSpreadScaleAdd = 100;
-} else {
+			aimSpreadScaleAdd = 100;
+		} else {
 // jpw
-	aimSpreadScaleAdd = 20;
-}
-break;
-case WP_SNOOPERSCOPE:
+			aimSpreadScaleAdd = 20;
+		}
+		break;
+	case WP_SNOOPERSCOPE:
 // JPW NERVE crippling the rifle a bit in multiplayer; it's way too strong so make it go completely out every time you fire
 // snooper doesn't do one-shot body kills, so give it a little less bounce
-addTime = ammoTable[pm->ps->weapon].nextShotTime;
+		addTime = ammoTable[pm->ps->weapon].nextShotTime;
 #ifdef CGAMEDLL
-if ( cg_gameType.integer != GT_SINGLE_PLAYER ) {
+		if ( cg_gameType.integer != GT_SINGLE_PLAYER ) {
 #endif
 #ifdef GAMEDLL
-if ( g_gametype.integer != GT_SINGLE_PLAYER ) {
+		if ( g_gametype.integer != GT_SINGLE_PLAYER ) {
 #endif
-aimSpreadScaleAdd = 50;
+			aimSpreadScaleAdd = 50;
 //			addTime *= 2;
-} else {
+		} else {
 // jpw
-	aimSpreadScaleAdd = 10;
-}
-break;
-
-case WP_FG42SCOPE:
-addTime = ammoTable[pm->ps->weapon].nextShotTime;
-aimSpreadScaleAdd = 10;
-break;
-
-case WP_FG42:
-case WP_MP40:
-case WP_THOMPSON:
-addTime = ammoTable[pm->ps->weapon].nextShotTime;
-aimSpreadScaleAdd = 15 + rand() % 10;       // (SA) new values for DM
-break;
-
-case WP_STEN:
-addTime = ammoTable[pm->ps->weapon].nextShotTime;
-aimSpreadScaleAdd = 15 + rand() % 10;       // (SA) new values for DM
-break;
-
-case WP_SILENCER:
-addTime = ammoTable[pm->ps->weapon].nextShotTime;
-aimSpreadScaleAdd = 35;
-break;
-
-case WP_VENOM:
-addTime = ammoTable[pm->ps->weapon].nextShotTime;
-aimSpreadScaleAdd = 10;
-break;
-
+			aimSpreadScaleAdd = 10;
+		}
+		break;
+	case WP_FG42SCOPE:
+		addTime = ammoTable[pm->ps->weapon].nextShotTime;
+		aimSpreadScaleAdd = 10;
+		break;
+	case WP_FG42:
+	case WP_MP40:
+	case WP_THOMPSON:
+		addTime = ammoTable[pm->ps->weapon].nextShotTime;
+		aimSpreadScaleAdd = 15 + rand() % 10;       // (SA) new values for DM
+		break;
+	case WP_STEN:
+		addTime = ammoTable[pm->ps->weapon].nextShotTime;
+		aimSpreadScaleAdd = 15 + rand() % 10;       // (SA) new values for DM
+		break;
+	case WP_SILENCER:
+		addTime = ammoTable[pm->ps->weapon].nextShotTime;
+		aimSpreadScaleAdd = 35;
+		break;
+	case WP_VENOM:
+		addTime = ammoTable[pm->ps->weapon].nextShotTime;
+		aimSpreadScaleAdd = 10;
+		break;
 // JPW NERVE
-case WP_CLASS_SPECIAL:
-// can't reliably get cvars for restart time in here, so set it small and check it in fireweapon routine
-addTime = 50;
-break;
+	case WP_CLASS_SPECIAL:
+		// can't reliably get cvars for restart time in here, so set it small and check it in fireweapon routine
+		addTime = 50;
+		break;
 // jpw
-case WP_MONSTER_ATTACK1:
-addTime = 1000;
-break;
-
-default:
-case WP_GAUNTLET:
-switch ( pm->ps->aiChar )
-{
-case AICHAR_LOPER:              // delay 'til next attack
-	addTime = 1000;
-	break;
-default:
-	addTime = 250;
-	break;
-}
-break;
-}
-
+	case WP_MONSTER_ATTACK1:
+		addTime = 1000;
+		break;
+	default:
+		case WP_GAUNTLET:
+		switch ( pm->ps->aiChar ) {
+		case AICHAR_LOPER:              // delay 'til next attack
+			addTime = 1000;
+			break;
+		default:
+			addTime = 250;
+			break;
+		}
+		break;
+	}
 
-// check for overheat
+	// check for overheat
 
-// the weapon can overheat, and it's hot
-if ( ( pm->ps->aiChar != AICHAR_PROTOSOLDIER ) &&
-	 ( pm->ps->aiChar != AICHAR_SUPERSOLDIER ) &&
-	 ( ammoTable[pm->ps->weapon].maxHeat && pm->ps->weapHeat[pm->ps->weapon] ) ) {
-	// it is overheating
-	if ( pm->ps->weapHeat[pm->ps->weapon] >= ammoTable[pm->ps->weapon].maxHeat ) {
-		pm->ps->weapHeat[pm->ps->weapon] = ammoTable[pm->ps->weapon].maxHeat;       // cap heat to max
-		PM_AddEvent( EV_WEAP_OVERHEAT );
+	// the weapon can overheat, and it's hot
+	if ( ( pm->ps->aiChar != AICHAR_PROTOSOLDIER ) &&
+		 ( pm->ps->aiChar != AICHAR_SUPERSOLDIER ) &&
+		 ( ammoTable[pm->ps->weapon].maxHeat && pm->ps->weapHeat[pm->ps->weapon] ) ) {
+		// it is overheating
+		if ( pm->ps->weapHeat[pm->ps->weapon] >= ammoTable[pm->ps->weapon].maxHeat ) {
+			pm->ps->weapHeat[pm->ps->weapon] = ammoTable[pm->ps->weapon].maxHeat;       // cap heat to max
+			PM_AddEvent( EV_WEAP_OVERHEAT );
 //			PM_StartWeaponAnim(WEAP_IDLE1);	// removed.  client handles anim in overheat event
-		addTime = 2000;         // force "heat recovery minimum" to 2 sec right now
+			addTime = 2000;         // force "heat recovery minimum" to 2 sec right now
+		}
 	}
-}
 
-if ( pm->ps->powerups[PW_HASTE] ) {
-	addTime /= 1.3;
-}
+	if ( pm->ps->powerups[PW_HASTE] ) {
+		addTime /= 1.3;
+	}
 
-// add the recoil amount to the aimSpreadScale
+	// add the recoil amount to the aimSpreadScale
 //	pm->ps->aimSpreadScale += 3.0*aimSpreadScaleAdd;
-//	if (pm->ps->aimSpreadScale > 255) pm->ps->aimSpreadScale = 255;
-pm->ps->aimSpreadScaleFloat += 3.0 * aimSpreadScaleAdd;
-if ( pm->ps->aimSpreadScaleFloat > 255 ) {
-	pm->ps->aimSpreadScaleFloat = 255;
-}
-pm->ps->aimSpreadScale = (int)( pm->ps->aimSpreadScaleFloat );
+//	if (pm->ps->aimSpreadScale > 255)
+//		pm->ps->aimSpreadScale = 255;
+	pm->ps->aimSpreadScaleFloat += 3.0 * aimSpreadScaleAdd;
+	if ( pm->ps->aimSpreadScaleFloat > 255 ) {
+		pm->ps->aimSpreadScaleFloat = 255;
+	}
+	pm->ps->aimSpreadScale = (int)( pm->ps->aimSpreadScaleFloat );
 
-pm->ps->weaponTime += addTime;
+	pm->ps->weaponTime += addTime;
 
-PM_SwitchIfEmpty();
+	PM_SwitchIfEmpty();
 }
 
 
diff --git a/SP/code/tools/lcc/src/dag.c b/SP/code/tools/lcc/src/dag.c
index 420cbe7..0f23651 100644
--- a/SP/code/tools/lcc/src/dag.c
+++ b/SP/code/tools/lcc/src/dag.c
@@ -518,8 +518,9 @@ void emitcode(void) {
 			       if (glevel > 0 && IR->stabline) {
 			       	(*IR->stabline)(&cp->u.point.src); swtoseg(CODE); } break;
 		case Gen: case Jump:
-		case Label:    if (cp->u.forest)
-			       	(*IR->emit)(cp->u.forest); break;
+		case Label:    if (cp->u.forest) {
+			       	(*IR->emit)(cp->u.forest);
+			       } break;
 		case Local:    if (glevel && IR->stabsym) {
 			       	(*IR->stabsym)(cp->u.var);
 			       	swtoseg(CODE);
diff --git a/SP/code/tools/lcc/src/expr.c b/SP/code/tools/lcc/src/expr.c
index 96eec21..e0c1aae 100644
--- a/SP/code/tools/lcc/src/expr.c
+++ b/SP/code/tools/lcc/src/expr.c
@@ -154,12 +154,13 @@ static Tree unary(void) {
 
 						  else if (isaddrop(p->op))
 						  	p->u.sym->addressed = 1;
- break;
+						  break;
 	case '+':    t = gettok(); p = unary(); p = pointer(p);
 						  if (isarith(p->type))
 						  	p = cast(p, promote(p->type));
 						  else
-						  	typeerror(ADD, p, NULL);  break;
+						  	typeerror(ADD, p, NULL);
+						  break;
 	case '-':    t = gettok(); p = unary(); p = pointer(p);
 						  if (isarith(p->type)) {
 						  	Type ty = promote(p->type);
@@ -170,18 +171,21 @@ static Tree unary(void) {
 						  	} else
 						  		p = simplify(NEG, ty, p, NULL);
 						  } else
-						  	typeerror(SUB, p, NULL); break;
+						  	typeerror(SUB, p, NULL);
+						  break;
 	case '~':    t = gettok(); p = unary(); p = pointer(p);
 						  if (isint(p->type)) {
 						  	Type ty = promote(p->type);
 						  	p = simplify(BCOM, ty, cast(p, ty), NULL);
 						  } else
-						  	typeerror(BCOM, p, NULL);  break;
+						  	typeerror(BCOM, p, NULL);
+						  break;
 	case '!':    t = gettok(); p = unary(); p = pointer(p);
 						  if (isscalar(p->type))
 						  	p = simplify(NOT, inttype, cond(p), NULL);
 						  else
-						  	typeerror(NOT, p, NULL); break;
+						  	typeerror(NOT, p, NULL);
+						  break;
 	case INCR:   t = gettok(); p = unary(); p = incr(INCR, pointer(p), consttree(1, inttype)); break;
 	case DECR:   t = gettok(); p = unary(); p = incr(DECR, pointer(p), consttree(1, inttype)); break;
 	case TYPECODE: case SIZEOF: { int op = t;
@@ -313,12 +317,13 @@ static Tree postfix(Tree p) {
 			    		q = rightkid(q);
 			    		if (isaddrop(q->op) && q->u.sym->temporary)
 			    			p = tree(RIGHT, p->type, p, NULL);
-			    	} else
-			    		error("left operand of . has incompatible type `%t'\n",
-			    			p->type);
+			    	} else {
+			    		error("left operand of . has incompatible type `%t'\n", p->type);
+			    	}
 			    	t = gettok();
-			    } else
-			    	error("field name expected\n"); break;
+			    } else {
+			    	error("field name expected\n");
+			    } break;
 		case DEREF: t = gettok();
 			    p = pointer(p);
 			    if (t == ID) {
@@ -326,12 +331,13 @@ static Tree postfix(Tree p) {
 			    		if (YYnull)
 			    			p = nullcheck(p);
 			    		p = field(p, token);
-			    	} else
+			    	} else {
 			    		error("left operand of -> has incompatible type `%t'\n", p->type);
-
+			    	}
 			    	t = gettok();
-			    } else
-			    	error("field name expected\n"); break;
+			    } else {
+			    	error("field name expected\n");
+			    } break;
 		default:
 			return p;
 		}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list