forked from github/server
commit
d541e8b1e3
|
@ -73,4 +73,4 @@ add_subdirectory (src eressea)
|
|||
install(DIRECTORY res conf DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.xml")
|
||||
install(DIRECTORY res conf DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.json")
|
||||
install(DIRECTORY scripts DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.lua")
|
||||
|
||||
install(DIRECTORY share DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
|
|
1
s/build
1
s/build
|
@ -6,6 +6,7 @@ done
|
|||
|
||||
[ -z $BUILD ] && BUILD=Debug
|
||||
MACHINE=`uname -m`
|
||||
[ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang"
|
||||
[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc"
|
||||
[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc"
|
||||
[ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
ROOT=$(pwd)
|
||||
while [ ! -d $ROOT/.git ]; do
|
||||
ROOT=$(dirname $ROOT)
|
||||
if [ "$ROOT" == "/" ; then
|
||||
if [ "/" = "$ROOT" ]; then
|
||||
echo "could not find root, are you in the git repository?"
|
||||
exit
|
||||
fi
|
||||
|
@ -25,4 +25,8 @@ programs="create-orders backup-eressea run-turn"
|
|||
for prg in ${programs} ; do
|
||||
install -v $ROOT/process/$prg $DEST/bin/
|
||||
done
|
||||
crontab $ROOT/process/cron/crontab
|
||||
|
||||
# install crontab, but only on the eressea server:
|
||||
HOST=`hostname`
|
||||
|
||||
[ "gruenbaer" = "$HOST" ] && crontab $ROOT/process/cron/crontab
|
||||
|
|
14
s/preview
14
s/preview
|
@ -1,5 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
MACHINE=`uname -m`
|
||||
[ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang"
|
||||
[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc"
|
||||
[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc"
|
||||
[ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc"
|
||||
BUILD="build-$MACHINE-$CC-Debug"
|
||||
|
||||
function usage() {
|
||||
cat <<HEREDOC
|
||||
usage: $0 [-t <turn>] [-g <game>] [-f <file>] command [args]
|
||||
|
@ -80,10 +87,11 @@ ln -f $LIVE/data/$turn.dat data/
|
|||
rm -rf reports
|
||||
mkdir -p reports
|
||||
|
||||
SERVER="$SOURCE/build-x86_64-gcc-Debug/eressea/eressea"
|
||||
SUPP="$SOURCE/share/ubuntu-12_04.supp"
|
||||
SERVER="$SOURCE/$BUILD/eressea/eressea"
|
||||
VALGRIND=$(which valgrind)
|
||||
if [ ! -z $VALGRIND ]; then
|
||||
SERVER="$VALGRIND --leak-check=no $SERVER"
|
||||
SERVER="$VALGRIND --suppressions=$SUPP --error-exitcode=1 --leak-check=no $SERVER"
|
||||
fi
|
||||
$SERVER -v$verbose -t$turn -re$game $SOURCE/scripts/run-turn.lua
|
||||
let turn=$turn+1
|
||||
|
@ -147,7 +155,7 @@ case "$1" in
|
|||
;;
|
||||
"run")
|
||||
if [ $turn -eq 0 ]; then
|
||||
[ -f $LIVE/turn ] || abort "missing turn file, and no turn specified"
|
||||
[ -f $LIVE/turn ] || abort "missing turn file in $LIVE, and no turn specified"
|
||||
let turn=$(cat $LIVE/turn)-1
|
||||
fi
|
||||
run
|
||||
|
|
|
@ -7,6 +7,7 @@ while [ ! -d $ROOT/.git ]; do
|
|||
done
|
||||
|
||||
MACHINE=`uname -m`
|
||||
[ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang"
|
||||
[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc"
|
||||
[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc"
|
||||
[ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc"
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
set -e
|
||||
ROOT=`pwd`
|
||||
SUPP=../share/ubuntu-12_04.supp
|
||||
MACHINE=`uname -m`
|
||||
[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc"
|
||||
[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc"
|
||||
|
@ -25,13 +26,13 @@ make
|
|||
test_valgrind_report () {
|
||||
cd $ROOT/tests
|
||||
ln -sf ../scripts/config.lua
|
||||
valgrind --suppressions=ubuntu-12_04.supp --error-exitcode=1 $BUILD/eressea/eressea -v0 -t184 ../scripts/reports.lua
|
||||
valgrind --suppressions=$SUPP --error-exitcode=1 $BUILD/eressea/eressea -v0 -t184 ../scripts/reports.lua
|
||||
}
|
||||
|
||||
test_valgrind_turn () {
|
||||
cd $ROOT/tests
|
||||
ln -sf ../scripts/config.lua
|
||||
valgrind --suppressions=ubuntu-12_04.supp --error-exitcode=1 $BUILD/eressea/eressea -v0 -t184 ../scripts/run-turn.lua
|
||||
valgrind --suppressions=$SUPP --error-exitcode=1 $BUILD/eressea/eressea -v0 -t184 ../scripts/run-turn.lua
|
||||
}
|
||||
|
||||
test_unittests() {
|
||||
|
|
|
@ -901,7 +901,9 @@ static void rmtroop(troop dt)
|
|||
rmfighter(df, 1);
|
||||
|
||||
assert(dt.index >= 0 && dt.index < df->unit->number);
|
||||
df->person[dt.index] = df->person[df->alive - df->removed];
|
||||
if (dt.index!=df->alive-df->removed) {
|
||||
df->person[dt.index] = df->person[df->alive - df->removed];
|
||||
}
|
||||
if (df->removed) {
|
||||
df->person[df->alive - df->removed] = df->person[df->alive];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue