From: 
Subject: Debian changes

The Debian packaging of bsdgames-nonfree is maintained in git, using a workflow
similar to the one described in dgit-maint-merge(7).
The Debian delta is represented by this one combined patch; there isn't a
patch queue that can be represented as a quilt series.

A detailed breakdown of the changes is available from their canonical
representation -- git commits in the packaging repository.
For example, to see the changes made by the Debian maintainer in the first
upload of upstream version 1.2.3, you could use:

    % git clone https://git.dgit.debian.org/bsdgames-nonfree
    % cd bsdgames-nonfree
    % git log --oneline 1.2.3..debian/1.2.3-1 -- . ':!debian'

(If you have dgit, use `dgit clone bsdgames-nonfree`, rather than plain `git clone`.)

We don't use debian/source/options single-debian-patch because it has bugs.
Therefore, NMUs etc. may nevertheless have made additional patches.

---

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..eb2b489
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*/*.d
+*/*.o
+GNUmakefile
+Makeconfig
+hide-game
+include/bsd-games.h
+install-man
+install-score
+rogue/pathnames.h
+rogue/rogue
+rogue/rogue.6
+subst.rules
+subst.sed
+
diff --git a/config.params b/config.params
new file mode 100644
index 0000000..8e79043
--- /dev/null
+++ b/config.params
@@ -0,0 +1,43 @@
+# -*- shell-script-mode -*-
+pkg=bsdgames-nonfree
+
+# Don't run configure interactively.
+bsd_games_cfg_non_interactive=y
+
+# Install into here for building the package.
+bsd_games_cfg_install_prefix=`pwd`/debian/$pkg
+
+# Do not build or install these games:
+bsd_games_cfg_no_build_dirs="dm banner fortune factor"
+
+# Keep huntd in /usr/sbin as it was in the past. I may 
+# change this later.
+bsd_games_cfg_sbindir=/usr/sbin
+
+bsd_games_cfg_docdir=/usr/share/doc/$pkg
+
+# Debian doesn't like cluttering up the /usr/*/games/ dirs too much,
+# use a subdir. /var too.
+bsd_games_cfg_usrlibdir=/usr/lib/games/$pkg
+bsd_games_cfg_sharedir=/usr/share/games/$pkg
+bsd_games_cfg_varlibdir=/var/games/$pkg
+
+## Do not do chown now, we aren't running as root.
+#bsd_games_cfg_do_chown=n
+
+# Debian prefers symlinks for manpages.
+bsd_games_cfg_use_dot_so=symlinks
+
+# I'll handle manpage compressing.
+bsd_games_cfg_gzip_manpages=n
+
+# Policy says to use /usr/bin/pager by default.
+bsd_games_cfg_pager=/usr/bin/pager
+
+# Leave off; debian/rules supplies all appropriate flags via
+# bsd_games_cfg_other_{c,ld}flags
+bsd_games_cfg_optimize_flags=
+
+# Make setgid games.
+bsd_games_cfg_score_game_group=games
+bsd_games_cfg_score_game_perms=2755
diff --git a/configure b/configure
index 017c6a4..0391948 100755
--- a/configure
+++ b/configure
@@ -64,6 +64,7 @@ ask () {
     esac
     eval $query_var=\"\$input\"
     subst_vars="$subst_vars $query_var"
+    echo $input
 }
 
 ask_yn () {
diff --git a/rogue/init.c b/rogue/init.c
index d077bf2..702334d 100644
--- a/rogue/init.c
+++ b/rogue/init.c
@@ -168,7 +168,7 @@ player_init()
 	obj = alloc_object();
 	obj->what_is = WEAPON;
 	obj->which_kind = BOW;
-	obj->damage = "1d2";
+	obj->damage = "1d1"; /* per object.c; was 1d2 */
 	obj->hit_enchant = 1;
 	obj->d_enchant = 0;
 	obj->identified = 1;
diff --git a/rogue/monster.c b/rogue/monster.c
index 2bcc25d..30b0705 100644
--- a/rogue/monster.c
+++ b/rogue/monster.c
@@ -688,7 +688,7 @@ create_monster()
 
 	for (i = 0; i < 9; i++) {
 		rand_around(i, &row, &col);
-		if (((row == rogue.row) && (col = rogue.col)) ||
+		if (((row == rogue.row) && (col == rogue.col)) ||
 				(row < MIN_ROW) || (row > (DROWS-2)) ||
 				(col < 0) || (col > (DCOLS-1))) {
 			continue;
diff --git a/rogue/move.c b/rogue/move.c
index c846b74..43dbd80 100644
--- a/rogue/move.c
+++ b/rogue/move.c
@@ -422,7 +422,7 @@ check_hunger(msg_only)
 		Subtract 0, i.e. do nothing.
 		break;*/
 	case -1:
-		rogue.moves_left -= (rogue.moves_left % 2);
+		rogue.moves_left -= m_moves % 2;
 		break;
 	case 0:
 		rogue.moves_left--;
@@ -430,7 +430,7 @@ check_hunger(msg_only)
 	case 1:
 		rogue.moves_left--;
 		(void) check_hunger(1);
-		rogue.moves_left -= (rogue.moves_left % 2);
+		rogue.moves_left -= m_moves % 2;
 		break;
 	case 2:
 		rogue.moves_left--;
diff --git a/rogue/object.c b/rogue/object.c
index 8364e51..262e18c 100644
--- a/rogue/object.c
+++ b/rogue/object.c
@@ -533,6 +533,13 @@ gr_weapon(obj, assign_wk)
 			}
 		}
 	}
+	assign_damage(obj);
+}
+
+void
+assign_damage(obj)
+	object *obj;
+{
 	switch(obj->which_kind) {
 	case BOW:
 	case DART:
@@ -556,6 +563,9 @@ gr_weapon(obj, assign_wk)
 	case TWO_HANDED_SWORD:
 		obj->damage = "4d5";
 		break;
+	default:
+		obj->damage = "1d1";
+		break;
 	}
 }
 
diff --git a/rogue/rogue.h b/rogue/rogue.h
index d8a6096..f9eaae9 100644
--- a/rogue/rogue.h
+++ b/rogue/rogue.h
@@ -464,6 +464,7 @@ void	add_mazes(void);
 void	add_traps(void);
 void	aggravate(void);
 void	aim_monster(object *);
+void    assign_damage(object *);
 void	bounce(short, short, short, short, short);
 void	byebye(int);
 void	c_object_for_wizard(void);
diff --git a/rogue/save.c b/rogue/save.c
index c7655ee..8fa106f 100644
--- a/rogue/save.c
+++ b/rogue/save.c
@@ -263,6 +263,10 @@ read_pack(pack, fp, is_rogue)
 		}
 		new_obj = alloc_object();
 		*new_obj = read_obj;
+		/* new_obj->damage is a pointer, and not guaranteed to be valid
+		 * across runs with slightly different binaries, or even the
+		 * same binary if built as a position-independent executable. */
+		assign_damage(new_obj);
 		if (is_rogue) {
 			if (new_obj->in_use_flags & BEING_WORN) {
 				do_wear(new_obj);
