func_train: Make sure we trigger PathDone() BEFRE switching to the new node

and remove the targetname check for PC_WAIT/TRAIN_WAIT spawnflags
This commit is contained in:
Marco Cawthorne 2021-03-12 02:48:08 +01:00
parent 2468f17680
commit d58e653e08
2 changed files with 2 additions and 3 deletions

View File

@ -6,7 +6,7 @@ grab_mod()
{
if [ -f "$SCRPATH/$1"/LICENSE ]; then
cd "$SCRPATH/$1"
git pull
git pull
else
cd "$SCRPATH"
git clone "$2" "$1"

View File

@ -167,6 +167,7 @@ func_train::PathNext(void)
}
SetOrigin(eNode.origin - (mins + maxs) * 0.5);
PathDone();
/* if speed is 0, retain current speed */
if (eNode.m_flSpeed > 0)
@ -179,11 +180,9 @@ func_train::PathNext(void)
/* warp */
if (eNode.spawnflags & PC_TELEPORT) {
SetOrigin(eNode.origin - (mins + maxs) * 0.5);
PathDone();
}
/* stop until triggered again */
if (targetname)
if (eNode.spawnflags & PC_WAIT || spawnflags & TRAIN_WAIT) {
SoundStop();
return;