foxygit / doom Log in
commit 0632e537f9277e7c3c0cbc2874be94531ff50134
Author:     Fabian Greffrath <fabian@greffrath.com>
AuthorDate: Wed Jun 18 13:06:25 2014 +0200
Commit:     Fabian Greffrath <fabian@greffrath.com>
CommitDate: Wed Jun 18 13:06:25 2014 +0200

    Move extern definitions for p_map.c to p_local.h

    This fixes conflicting array sizes for the variable "spechit" as
    reported in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=748393.

    Fixes #414
---
 src/doom/p_enemy.c |  5 -----
 src/doom/p_local.h | 14 ++++++++++++++
 src/doom/p_map.c   | 11 -----------
 3 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/src/doom/p_enemy.c b/src/doom/p_enemy.c
index ba2b011b..a7df6a01 100644
--- a/src/doom/p_enemy.c
+++ b/src/doom/p_enemy.c
@@ -257,11 +257,6 @@ boolean P_CheckMissileRange (mobj_t* actor)
 fixed_t	xspeed[8] = {FRACUNIT,47000,0,-47000,-FRACUNIT,-47000,0,47000};
 fixed_t yspeed[8] = {0,47000,FRACUNIT,47000,0,-47000,-FRACUNIT,-47000};

-#define MAXSPECIALCROSS	8
-
-extern	line_t*	spechit[MAXSPECIALCROSS];
-extern	int	numspechit;
-
 boolean P_Move (mobj_t*	actor)
 {
     fixed_t	tryx;
diff --git a/src/doom/p_local.h b/src/doom/p_local.h
index fea6f1ea..95fa4053 100644
--- a/src/doom/p_local.h
+++ b/src/doom/p_local.h
@@ -208,6 +208,20 @@ extern fixed_t		tmceilingz;

 extern	line_t*		ceilingline;

+// fraggle: I have increased the size of this buffer.  In the original Doom,
+// overrunning past this limit caused other bits of memory to be overwritten,
+// affecting demo playback.  However, in doing so, the limit was still
+// exceeded.  So we have to support more than 8 specials.
+//
+// We keep the original limit, to detect what variables in memory were
+// overwritten (see SpechitOverrun())
+
+#define MAXSPECIALCROSS 		20
+#define MAXSPECIALCROSS_ORIGINAL	8
+
+extern	line_t*	spechit[MAXSPECIALCROSS];
+extern	int	numspechit;
+
 boolean P_CheckPosition (mobj_t *thing, fixed_t x, fixed_t y);
 boolean P_TryMove (mobj_t* thing, fixed_t x, fixed_t y);
 boolean P_TeleportMove (mobj_t* thing, fixed_t x, fixed_t y);
diff --git a/src/doom/p_map.c b/src/doom/p_map.c
index bf92fcea..e371869a 100644
--- a/src/doom/p_map.c
+++ b/src/doom/p_map.c
@@ -82,17 +82,6 @@ line_t*		ceilingline;
 // keep track of special lines as they are hit,
 // but don't process them until the move is proven valid

-// fraggle: I have increased the size of this buffer.  In the original Doom,
-// overrunning past this limit caused other bits of memory to be overwritten,
-// affecting demo playback.  However, in doing so, the limit was still
-// exceeded.  So we have to support more than 8 specials.
-//
-// We keep the original limit, to detect what variables in memory were
-// overwritten (see SpechitOverrun())
-
-#define MAXSPECIALCROSS 		20
-#define MAXSPECIALCROSS_ORIGINAL	8
-
 line_t*		spechit[MAXSPECIALCROSS];
 int		numspechit;