halflife icon indicating copy to clipboard operation
halflife copied to clipboard

hlds_run broken "quit" command

Open aaarnas opened this issue 13 years ago • 0 comments

Hi, with this update: https://github.com/ValveSoftware/halflife/issues/210 cmd "quit" was made ineffective. Now you can't shutdown a server by typing it.

There is no logic anymore. If $RESTART variable is "yes" (as by default is), then we have situation: test -z "$RESTART" equals false always and break not called, so we are making endless loop of restart.

Another illogic - if we won't auto restart server after crash - debug isn't called debugcore $retval.

So this should be changed: hlds_run line 275 run():

if test $retval -eq 0 && test -z "$RESTART" ; then
    break; # if 0 is returned then just quit
fi

debugcore $retval

to

if test $retval -eq 0 ; then
    break; # if 0 is returned then just quit
fi

debugcore $retval

if test -z "$RESTART" ; then
    break; # no need to restart on crash
fi

Now if we type "quit", shutting down a server. If it's terminated by another reason, debug it and then determine restart or not.

aaarnas avatar Oct 17 '13 18:10 aaarnas