#!/usr/bin/perl
#
# Empire - A multi-player, client/server Internet based war game.
-# Copyright (C) 1986-2014, Dave Pare, Jeff Bailey, Thomas Ruschak,
+# Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
# Ken Stevens, Steve McClure, Markus Armbruster
#
# Empire is free software: you can redistribute it and/or modify
#
# Known contributors to this file:
# Ken Stevens (when it was still info.pl)
-# Markus Armbruster, 2006-2013
+# Markus Armbruster, 2006-2016
#
# Usage: mksubj.pl SUBJECT... INFO-FILE...
#
my @Levels = qw/Basic Expert Obsolete/;
-# $Subjects{SUBJECT} is a reference to an an anonymous array
+# $Subjects{SUBJECT} is a reference to an anonymous array
# containing SUBJECT's topics
my %Subjects;
update_subj($_);
}
+write_toc();
+
sub fn2topic {
my ($fn) = @_;
$fn =~ s,.*/([^/]*)\.t$,$1,;
return $contents eq $old;
}
+sub write_toc {
+ my @toc;
+ for (keys %chapter) {
+ push @toc, "$chapter{$_} $_";
+ }
+ open(TOC, ">info/toc")
+ or die "Can't open info/toc for writing: $!";
+ print TOC join("\n", sort @toc);
+ print TOC "\n";
+ close TOC;
+}
+
# Print an integrity error message and exit with code 1
sub error {
my ($error) = @_;