#!/bin/sh
progdir=$(dirname "$0")/Diablo
cd $progdir
HOME=$progdir

export LD_LIBRARY_PATH="$progdir/lib:$LD_LIBRARY_PATH"
./j2k &
./devilutionx --config-dir $progdir --data-dir $progdir --save-dir $progdir
killall j2k
sed -i -e '/Game=1/c Game=' $progdir/diablo.ini
sed -i -e '/Game=2/c Game=' $progdir/diablo.ini
sync
