From 073a005c194cb43a8fa9bd1b11f50cda72c94c22 Mon Sep 17 00:00:00 2001
From: johns <>
Date: Thu, 27 Apr 2000 22:45:50 +0000
Subject: [PATCH] should now compile, like distributed

---
 Rules.make.orig         |  2 +-
 setup                   |  6 ++++--
 src/include/map.h       | 16 +++++++++++++++-
 src/network/network.cpp |  3 +++
 src/unit/unit.cpp       |  2 +-
 5 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/Rules.make.orig b/Rules.make.orig
index 90ec3d2ab..86a95bb8b 100644
--- a/Rules.make.orig
+++ b/Rules.make.orig
@@ -204,7 +204,7 @@ IFLAGS=	-I$(TOPDIR)/src/include $(XIFLAGS)
 ## define flags
 DEBUG=	-DDEBUG #-DNEW_AI # -DFLAG_DEBUG
 DFLAGS=	$(THREAD) $(CCL) $(VERSION) $(GLIB) $(VIDEO) $(ZDEFS) $(DSOUND) \
-	$(DEBUG) -DNEW_UNIT -DNEW_NETWORK # -DNEW_VIDEO -DNEW_NAMES
+	$(DEBUG) -DNEW_UNIT -DNEW_NETWORK -DNEW_HEADING # -DNEW_VIDEO -DNEW_NAMES
 
 ## choose optimise level
 #CFLAGS=-g -O0 $(PROFILE) -pipe -Wall -Werror $(IFLAGS) $(DFLAGS)
diff --git a/setup b/setup
index 627ff964a..060d3990d 100755
--- a/setup
+++ b/setup
@@ -33,7 +33,7 @@ MAKE=make
 #------------------------------------------------------------------------------
 # DON'T CHANGE ANYTHING FROM HERE DOWN UNLESS YOU KNOW WHAT YOU ARE DOING
 
-VERSION="-DVERSION=\"1.17pre1-build1\""
+VERSION="-DVERSION=\"1.17pre1-build2\""
 WIN32=-1
 
 # Choose optimization level
@@ -442,7 +442,9 @@ if test "$DEBUG" = 1 ; then
 fi
 echo "DFLAGS=	\$(THREAD) \$(CCL) \$(VERSION) \\" >> $RULESFILE
 echo "	\$(VIDEO) \$(ZDEFS) \$(DSOUND) \\" >> $RULESFILE
-echo "	\$(DEBUG) -DNEW_VIDEO" >> $RULESFILE
+echo "	\$(DEBUG) " >> $RULESFILE
+# This could be used
+# -DNEW_UNIT -DNEW_NETWORK -DNEW_HEADING # -DNEW_VIDEO -DNEW_NAMES
 
 echo "CFLAGS=$CFLAGS $STATIC $EXTRA_CFLAGS" >> $RULESFILE
 
diff --git a/src/include/map.h b/src/include/map.h
index 92b1b3bd8..89e4ef301 100644
--- a/src/include/map.h
+++ b/src/include/map.h
@@ -50,8 +50,20 @@
 typedef struct _map_field_ {
     unsigned short	Tile;		/// graphic tile number
     unsigned short	SeenTile;	/// last seen tile (FOW)
-    unsigned char	Value;		/// HP for walls
     unsigned short	Flags;		/// field flags
+    unsigned char	Value;		/// HP for walls/ Wood Regeneration
+#ifdef NEW_FOW
+    unsigned char	VisibileMask:4;	/// Visibile mask
+    unsigned char	ExploredMask:4;	/// Explored mask
+    unsigned short	Visibile;	/// Visibile flags for all players.
+    unsigned short	Explored;	/// Explored flags for all players.
+#endif
+#ifdef UNIT_ON_MAP
+    union {
+	Unit*		Units;		/// An unit on the map field.
+	Unit**		Array;		/// More units on the map field.
+    }			Here;		/// What is on the field.
+#endif
 #ifdef UNITS_ON_MAP
     UnitRef		Building;	/// Building or corpse.
     UnitRef		AirUnit;	/// Air unit.
@@ -63,6 +75,8 @@ typedef struct _map_field_ {
 #define MapFieldVisible		0x0001	/// Field visible
 #define MapFieldExplored	0x0002	/// Field explored
 
+#define MapFieldArray		0x0004	/// More than one unit on the field
+
 #define MapFieldHuman		0x0008	/// Human is owner of the field (walls)
 
 #define MapFieldLandAllowed	0x0010	/// Land units allowed
diff --git a/src/network/network.cpp b/src/network/network.cpp
index cd6931746..402f13e9e 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -137,6 +137,9 @@ extern void NetworkSendCommand(int command,Unit* unit,int x,int y
 
 global int NetworkFildes = -1;		/// Network file descriptor
 global int NetworkInSync = 1;		/// Network is in sync
+global int NetworkUpdates = 5;		/// Network update each # frames
+global char* NetworkArg;		/// Network command line argument
+global int NetworkLag = 10;		/// Network lag in # frames
 
 /*----------------------------------------------------------------------------
 --	Communication over the network.
diff --git a/src/unit/unit.cpp b/src/unit/unit.cpp
index fba2dc34e..053aa4527 100644
--- a/src/unit/unit.cpp
+++ b/src/unit/unit.cpp
@@ -845,7 +845,7 @@ global void UnitIncrementHealth(void)
     for( i=0; i< NumUnits; i++) {
 	unit=Units[i];
 	if( unit->Type==berserker
-		&& unit->HP<unit->Stats->HP
+		&& unit->HP<unit->Stats->HitPoints
 		&& UpgradeIdAllowed(unit->Player,regeneration)=='R' ) {
 	    ++unit->HP;			// FIXME: how fast do we regenerate
 	}