summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2011-02-05 16:20:55 +0000
committeralberth <alberth@openttd.org>2011-02-05 16:20:55 +0000
commitb992a939966dfe50e16688d1f30767a50b2d2bc5 (patch)
treefcb370af3a43975d1021087fda7e86e515164762 /src/train_cmd.cpp
parent915e339d0f395305ec722925bfd8f4fdd09f30a3 (diff)
downloadopenttd-b992a939966dfe50e16688d1f30767a50b2d2bc5.tar.xz
(svn r21976) -Doc: Document several crash handling functions.
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 883f46fae..506845d59 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -3299,6 +3299,10 @@ static void DeleteLastWagon(Train *v)
}
}
+/**
+ * Rotate all vehicles of a (crashed) train chain randomly to animate the crash.
+ * @param v First crashed vehicle.
+ */
static void ChangeTrainDirRandomly(Train *v)
{
static const DirDiff delta[] = {
@@ -3319,6 +3323,11 @@ static void ChangeTrainDirRandomly(Train *v)
} while ((v = v->Next()) != NULL);
}
+/**
+ * Handle a crashed train.
+ * @param v First train vehicle.
+ * @return %Vehicle chain still exists.
+ */
static bool HandleCrashedTrain(Train *v)
{
int state = ++v->crash_anim_pos;