--- bin/ut.orig	2005-03-01 03:04:02.000000000 -0600
+++ bin/ut	2009-06-14 17:05:12.000000000 -0500
@@ -68,6 +68,18 @@
 cd $GAME_DIR
 cd $SUBDIR
 
+# The Nvidia driver needs this to prevent the speed from being too fast when
+# facing things such as walls.
+sysctl hw.nvidia.version > /dev/null 2>&1
+if [ ${?} -eq 0 ]
+then
+	export __GL_SYNC_TO_VBLANK=${__GL_SYNC_TO_VBLANK:-"1"}
+fi
+
+# This is needed to prevent the following error:
+#     XDM authorization key matches an existing client
+export LD_PRELOAD=/usr/lib/libX11.so.6
+
 LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$PWD
 export LD_LIBRARY_PATH
 
@@ -75,6 +87,9 @@
 ./$GAME_BINARY "$CMD_ARGS" "$@"
 EXITCODE="$?"
 
+# Remove the preload before running any other command.
+unset LD_PRELOAD
+
 # reset kb layout
 setxkbmap
 
