shithub: choc

Download patch

ref: 5aa95863f364142d404a989eec0d28844352811a
parent: 6ae54ada023321ec629a52cc4f91ccd8e3aa06ff
author: James Haley <haleyjd@hotmail.com>
date: Tue Sep 21 20:10:59 EDT 2010

Fixed firing of missiles when looking up/down so that the aimslope
calculated in P_AimLineAttack is used. Added W1 handling for linetype
182 to P_CrossSpecialLine, which lets missiles break windows. Corrected
numerous mistakes in the implementation of P_ChangeSwitchTexture.

Subversion-branch: /branches/strife-branch
Subversion-revision: 2128

--- a/src/strife/p_map.c
+++ b/src/strife/p_map.c
@@ -1214,11 +1214,11 @@
   angle_t	angle,
   fixed_t	distance )
 {
-    fixed_t	x2;
-    fixed_t	y2;
+    fixed_t     x2;
+    fixed_t     y2;
 
     t1 = P_SubstNullMobj(t1);
-	
+
     angle >>= ANGLETOFINESHIFT;
     shootthing = t1;
     
@@ -1232,14 +1232,14 @@
     
     attackrange = distance;
     linetarget = NULL;
-	
+
     P_PathTraverse ( t1->x, t1->y,
-		     x2, y2,
-		     PT_ADDLINES|PT_ADDTHINGS,
-		     PTR_AimTraverse );
-		
+                     x2, y2,
+                     PT_ADDLINES|PT_ADDTHINGS,
+                     PTR_AimTraverse );
+
     if (linetarget)
-	return aimslope;
+        return aimslope;
     else    // villsa [STRIFE] checks for player pitch
     {
         if(t1->player)
--- a/src/strife/p_mobj.c
+++ b/src/strife/p_mobj.c
@@ -1177,6 +1177,8 @@
 //
 // Tries to aim at a nearby monster
 // villsa [STRIFE] now returns a mobj
+// * Also modified to allow up/down look, and to account for foot-clipping
+//   by liquid terrain.
 //
 mobj_t* P_SpawnPlayerMissile(mobj_t* source, mobjtype_t type)
 {
@@ -1206,7 +1208,9 @@
         if (!linetarget)
         {
             an = source->angle;
-            slope = 0;
+
+            // haleyjd 09/21/10: [STRIFE] Removed, for look up/down support.
+            //slope = 0; 
         }
     }
 
--- a/src/strife/p_spec.c
+++ b/src/strife/p_spec.c
@@ -627,7 +627,7 @@
         case 231:       // haleyjd: STRIFE-TODO: Identify type
         case 125:       // TELEPORT MONSTERONLY TRIGGER
         case 126:       // TELEPORT MONSTERONLY RETRIGGER
-        case 182:       // haleyjd: STRIFE-TODO: Identify type
+        case 182:       // haleyjd: [STRIFE] Break glass - it's a cross type too!
         case 10:        // PLAT DOWN-WAIT-UP-STAY TRIGGER
         case 39:        // TELEPORT TRIGGER
         case 88:        // PLAT DOWN-WAIT-UP-STAY RETRIGGER
@@ -643,8 +643,10 @@
     // Note: could use some const's here.
     switch (line->special)
     {
+        //
         // TRIGGERS.
         // All from here to RETRIGGERS.
+        //
     case 2:
         // Open Door
         EV_DoDoor(line,open);
@@ -865,6 +867,8 @@
 
     case 124:
         // Secret EXIT
+        // [STRIFE] No secret exits;
+        // STRIFE-TODO: is this reused for something else?
         //G_SecretExitLevel ();
         break;
 
@@ -889,7 +893,29 @@
         line->special = 0;
         break;
 
+    case 174:
+        // villsa [STRIFE] Split Open
+        EV_DoDoor(line, splitOpen);
+        line->special = 0;
+        break;
+
+    case 182:
+        // haleyjd 09/21/10: [STRIFE]
+        // 182 is a unique linetype in that it is both a G1 and a W1 linetype,
+        // but only missiles may activate it as a W1 type.
+        if(thing->flags & MF_MISSILE)
+            P_ChangeSwitchTexture(line, 1); // why 1? it will be cleared anyway.
+        break;
+
+    case 183:
+        // villsa [STRIFE] Split Raise Nearest
+        EV_DoDoor(line, splitRaiseNearest);
+        line->special = 0;
+        break;
+
+        //
         // RETRIGGERS.  All from here till end.
+        //
     case 72:
         // Ceiling Crush
         EV_DoCeiling( line, lowerAndCrush );
@@ -1071,7 +1097,7 @@
             }
 
             DEH_snprintf(msgbuf, sizeof(msgbuf), "Entering%s", 
-                         mapnames[map - 1] + 8);
+                         DEH_String(mapnames[map - 1]) + 8);
             thing->player->message = msgbuf;
 
             if(netgame && deathmatch)
@@ -1101,18 +1127,8 @@
             }
         }
         break;
-
-    case 174:
-        // villsa [STRIFE] Split Open
-        EV_DoDoor(line, splitOpen);
-        line->special = 0;
-        break;
-
-    case 183:
-        // villsa [STRIFE] Split Raise Nearest
-        EV_DoDoor(line, splitRaiseNearest);
-        line->special = 0;
-        break;
+        
+        // haleyjd 09/21/10: Moved one-time-use lines up above with the others.
     }
 }
 
--- a/src/strife/p_switch.c
+++ b/src/strife/p_switch.c
@@ -263,7 +263,6 @@
 
     sound = sfx_swtchn;
 
-    // EXIT SWITCH?
     // villsa [STRIFE] check for linetype 182 (break glass)
     if(line->special == 182)
     {
@@ -272,11 +271,12 @@
 
         if(useAgain)
         {
-            texMid = 0;
+            // haleyjd 09/21/10: Corrected (>> 16 == next field)
             texTop = 0;
+            texBot = 0;
         }
 
-        if(texBot)
+        if(texMid) // haleyjd 09/21/10: Corrected (>> 16 == next field)
             useAgain = 0;
 
         sound = sfx_bglass;
@@ -295,7 +295,7 @@
             if(sl->sound)
                 sound = sl->sound;
 
-            S_StartSound(buttonlist->soundorg,sound);
+            S_StartSound(buttonlist->soundorg, sound);
             sides[line->sidenum[0]].toptexture = switchlist[i^1];
 
             if(useAgain)
@@ -318,6 +318,7 @@
                 sides[line->sidenum[0]].midtexture = switchlist[i^1];
 
                 // villsa [STRIFE] affect second side of line
+                // BUG: will crash if 1S line is marked with TWOSIDED flag!
                 if(line->flags & ML_TWOSIDED)
                     sides[line->sidenum[1]].midtexture = switchlist[i^1];
 
@@ -324,7 +325,7 @@
                 if(useAgain)
                     P_StartButton(line, middle,switchlist[i],BUTTONTIME);
 
-                // villsa [STRIFE]
+                // villsa [STRIFE]: Mines Converter hack
                 if(sound == sfx_firxpl)
                 {
                     breakglass = true;