]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Mario/monsters
authorMario <mario.mario@y7mail.com>
Fri, 18 Oct 2013 22:40:46 +0000 (09:40 +1100)
committerMario <mario.mario@y7mail.com>
Fri, 18 Oct 2013 22:40:46 +0000 (09:40 +1100)
30 files changed:
commands.cfg
defaultXonotic.cfg
gfx/menu/luminos/skinvalues.txt
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/progs.src
qcsrc/common/if-this-file-errors-scroll-up-and-fix-the-warnings.fteqccfail [deleted file]
qcsrc/common/mapinfo.qc
qcsrc/common/notifications.qh
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/dpdefs/csprogsdefs.qc
qcsrc/dpdefs/dpextensions.qc
qcsrc/dpdefs/menudefs.qc
qcsrc/menu/command/menu_cmd.qc
qcsrc/menu/draw.qc
qcsrc/menu/item/textslider.c
qcsrc/menu/menu.qc
qcsrc/menu/progs.src
qcsrc/menu/xonotic/dialog_settings_misc.c
qcsrc/menu/xonotic/dialog_settings_video.c
qcsrc/menu/xonotic/slider_resolution.c
qcsrc/server/cheats.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/defs.qh
qcsrc/server/g_damage.qc
qcsrc/server/g_subs.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/progs.src
qcsrc/server/t_plats.qc

index ac7316f07514bf9e14f35ced0cf88d1d6d3354ae..bcb13758df3b8a4f3eec02f8f1d53653232136c4 100644 (file)
@@ -124,6 +124,7 @@ alias hud                  "qc_cmd_cl     hud                  ${* ?}" // Comman
 alias localprint           "qc_cmd_cl     localprint           ${* ?}" // Create your own centerprint sent to yourself
 //alias mv_download        "qc_cmd_cl     mv_download          ${* ?}" // Retrieve mapshot picture from the server
 alias sendcvar             "qc_cmd_cl     sendcvar             ${* ?}" // Send a cvar to the server (like weaponpriority)
+alias exit                 "quit"
 
 // other aliases for local commands
 alias hud_configure "qc_cmd_cl hud configure"
@@ -342,6 +343,7 @@ alias vdomap "vdo gotomap ${1 ?}"
 alias vdokick "vdo kick ${* ?}"
 alias vdokickban "vdo kickban ${* ?}"
 alias vdoend "vdo endmatch"
+alias vext "vcall extendmatchtime"
 
 // ======================
 //  rcon server commands
index 3e7fa208bb972e9a46215c6ea9479051212f7673..71eacf453e69103e8a3ec425518541b3d6d89d01 100644 (file)
@@ -237,7 +237,7 @@ set g_maxplayers_spectator_blocktime 5      "if the players voted for the \"nospectat
 set g_warmup 0 "split the game into a warmup- and match-stage when set to 1"
 set g_warmup_limit 0   "if set to -1 the warmup-stage is not affected by any timelimit, if set to 0 the usual timelimit also affects warmup-stage, otherwise warmup will be limited to this time in SECONDS (useful for public matches)"
 set g_warmup_allow_timeout 0   "if set to 1 timeouts can also be called in the warmup-stage, when sv_timeout is set to 1"
-set g_warmup_allguns 1 "if set players start with all guns in warmup mode"
+set g_warmup_allguns 1 "provide more weapons on start while in warmup: 0 = normal start weapons, 1 = all guns available on the map, 2 = all normal weapons"
 set g_warmup_majority_factor 0.8 "minimum percentage of players ready needed for warmup to end"
 
 set g_chat_nospectators 0      "if 0 spec/observer chat is always visible to the player, if 1 it is never visible to players, if 2 it is only visible to players during warmup stage"
index e79dba0e099fd157d28f4c8f7ad7692b3568f7c1..5e311c9090adaef842639e5a1d0dc5165e559423 100755 (executable)
@@ -126,7 +126,7 @@ COLOR_SERVERINFO_IP             '1 0.4375 0'
 
 // item: server list
 ALPHA_SERVERLIST_FULL           0.4
-ALPHA_SERVERLIST_EMPTY          0.7
+ALPHA_SERVERLIST_EMPTY          0.6
 COLOR_SERVERLIST_LOWPING        '0 1 0'
 COLOR_SERVERLIST_MEDPING        '1 0.75 0'
 COLOR_SERVERLIST_HIGHPING       '1 0 0'
index b2c98e4ed4aab27040de2b888c0a6ef1a5f3431c..3837ed4c97b50823be3f604172221766a4c79cbb 100644 (file)
@@ -180,7 +180,7 @@ void CSQCPlayer_ModelAppearance_Apply(float islocalplayer)
        float isfriend;
        float cm;
        cm = self.forceplayermodels_savecolormap;
-       cm = (cm >= 1024) ? cm : (stof(getplayerkeyvalue(self.colormap - 1, "colors")) + 1024);
+       cm = (cm >= 1024) ? cm : (stof(getplayerkeyvalue(cm - 1, "colors")) + 1024);
 
        if(teamplay)
                isfriend = (cm == 1024 + 17 * myteam);
index 56fe8d2065ffaaab3a4a484449a213de55445fda..1a518c5a697f9079977a896ae21cf841cdedeb17 100644 (file)
@@ -125,5 +125,3 @@ tturrets.qc
 
 player_skeleton.qc
 ../common/animdecide.qc
-
-../common/if-this-file-errors-scroll-up-and-fix-the-warnings.fteqccfail
diff --git a/qcsrc/common/if-this-file-errors-scroll-up-and-fix-the-warnings.fteqccfail b/qcsrc/common/if-this-file-errors-scroll-up-and-fix-the-warnings.fteqccfail
deleted file mode 100644 (file)
index e69de29..0000000
index 7949b4c2257e840cd9ee6d1831bf6634f8cda50a..aa906d68418999f3c01518d5ba2546bd2e66c6c5 100644 (file)
@@ -913,7 +913,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, float pAllowGenerate, flo
                        else
                                fputs(fh, "// uncomment this if you added turrets: has turrets\n");
                        if(MapInfo_Map_supportedFeatures & MAPINFO_FEATURE_VEHICLES)
-                               fputs(fh, "has weapons\n");
+                               fputs(fh, "has vehicles\n");
                        else
                                fputs(fh, "// uncomment this if you added vehicles: has vehicles\n");
                        if(MapInfo_Map_flags & MAPINFO_FLAG_FRUSTRATING)
index 26c711f37c95f7cd105d89c4101101bfe5554e2c..ad7e3a23381edbbb09e32914a6b5b0e4cc0fc7ed 100644 (file)
@@ -230,7 +230,7 @@ void Send_Notification_WOCOVA(
        MSG_ANNCE_NOTIF(default, prefix##YELLOW, channel, sprintf(sound, strtolower(STATIC_NAME_TEAM_3)), volume, position) \
        MSG_ANNCE_NOTIF(default, prefix##PINK, channel, sprintf(sound, strtolower(STATIC_NAME_TEAM_4)), volume, position)
 #define MULTITEAM_ANNCE(default,prefix,teams,channel,sound,volume,position) \
-       MSG_ANNCE_NOTIF_##teams(default,prefix,channel,sound,volume,position) \
+       MULTITEAM_ANNCE##teams(default,prefix,channel,sound,volume,position)
 
 #define MSG_ANNCE_NOTIFICATIONS \
        MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_AIRSHOT,       CH_INFO, "airshot",           VOL_BASEVOICE, ATTEN_NONE) \
index 965431773e3d572162192da7b5ce2a2076c133c8..85efe4144a17355d23cac22ab1ec02dfa37f4070 100644 (file)
@@ -2492,6 +2492,28 @@ float cubic_speedfunc_is_sane(float startspeedfactor, float endspeedfactor)
        // (3, [0..3])
        // (3.5, [0.2..2.3])
        // (4, 1)
+
+       /*
+          On another note:
+          inflection point is always at (2s + e - 3) / (3s + 3e - 6).
+
+          s + e - 2 == 0: no inflection
+
+          s + e > 2:
+          0 < inflection < 1 if:
+          0 < 2s + e - 3 < 3s + 3e - 6
+          2s + e > 3 and 2e + s > 3
+
+          s + e < 2:
+          0 < inflection < 1 if:
+          0 > 2s + e - 3 > 3s + 3e - 6
+          2s + e < 3 and 2e + s < 3
+
+          Therefore: there is an inflection point iff:
+          e outside (3 - s)/2 .. 3 - s*2
+          
+          in other words, if (s,e) in triangle (1,1)(0,3)(0,1.5) or in triangle (1,1)(3,0)(1.5,0)
+       */
 }
 
 .float FindConnectedComponent_processing;
index 6a16886df4b8add4075068db0f62fa270976e5a2..a5ef7b3afc06026707fa60845cafc688a6f1fe6e 100644 (file)
@@ -6,6 +6,12 @@
 // a dummy macro that prevents the "hanging ;" warning
 #define ENDS_WITH_CURLY_BRACE
 
+#ifdef GMQCC
+# define ACCUMULATE_FUNCTION(func,otherfunc) \
+       [[accumulate]] void func() { otherfunc(); }
+# define CALL_ACCUMULATED_FUNCTION(func) \
+       func()
+#else
 #ifdef HAVE_YO_DAWG_CPP
 // TODO make ascii art pic of xzibit
 // YO DAWG!
@@ -41,6 +47,7 @@ void ACCUMULATE_call(string func)
 # define CALL_ACCUMULATED_FUNCTION(func) \
        ACCUMULATE_call(#func)
 #endif
+#endif
 
 // used for simplifying ACCUMULATE_FUNCTIONs
 #define SET_FIRST_OR_LAST(input,first,count) if(!input) { input = (first + count); }
index f858afba2fdaa3457f8c1cc33b63dfcf336a9b3c..324f8082f75bf98f12fa9026a154ed3e91532c55 100644 (file)
@@ -447,6 +447,7 @@ string(float ccase, float calpha, float cnum, string s, ...) strconv = #224;
 string(float chars, string s, ...) strpad = #225;
 string(string info, string key, string value, ...) infoadd = #226;
 string(string info, string key) infoget = #227;
+float(string s1, string s2) strcmp = #228;
 float(string s1, string s2, float len) strncmp = #228;
 float(string s1, string s2) strcasecmp = #229;
 float(string s1, string s2, float len) strncasecmp = #230;
index 0a5504392736ebd13e4ee1456a5bb39e80a71950..39a2f593a1e0e8ec792b5c6f4f8b86115fce7632 100644 (file)
@@ -2426,6 +2426,7 @@ string(float ccase, float calpha, float cnum, string s, ...) strconv = #224; //
 string(float chars, string s, ...) strpad = #225; // pad string with spaces to a specified length, < 0 = left padding, > 0 = right padding
 string(string info, string key, string value, ...) infoadd = #226; // sets or adds a key/value pair to an infostring - note: forbidden characters are \ and "
 string(string info, string key) infoget = #227; // gets a key/value pair in an infostring, returns value or null if not found
+float(string s1, string s2) strcmp = #228; // compare two strings
 float(string s1, string s2, float len) strncmp = #228; // compare two strings up to the specified number of characters, if their length differs and is within the specified limit the result will be negative, otherwise it is the difference in value of their first non-matching character.
 float(string s1, string s2) strcasecmp = #229; // compare two strings with case-insensitive matching, characters a-z are considered equivalent to the matching A-Z character, no other differences, and this does not consider special characters equal even if they look similar
 float(string s1, string s2, float len) strncasecmp = #230; // same as strcasecmp but with a length limit, see strncmp
index af5b41aee04bb227b27088d7c280173fdc97a72a..2c21cd181ec367dd0140b2e754505b3b4a3dc6a0 100644 (file)
@@ -400,6 +400,7 @@ string(float ccase, float calpha, float cnum, string s, ...) strconv = #224;
 string(float chars, string s, ...) strpad = #225;
 string(string info, string key, string value, ...) infoadd = #226;
 string(string info, string key) infoget = #227;
+float(string s1, string s2) strcmp = #228;
 float(string s1, string s2, float len) strncmp = #228;
 float(string s1, string s2) strcasecmp = #229;
 float(string s1, string s2, float len) strncasecmp = #230;
index 2c0b1edf38aa33fcd42e6117bf4a5c6c108bd04a..c7499e58e40a8a94ba1f31f2c504f0310bb465a3 100644 (file)
@@ -51,6 +51,12 @@ void GameCommand(string theCommand)
                return;
        }
 
+       if(argv(0) == "update_conwidths_before_vid_restart")
+       {
+               updateConwidths(cvar("vid_width"), cvar("vid_height"), cvar("vid_pixelheight"));
+               return;
+       }
+
        if(argv(0) == "directmenu" || argv(0) == "directpanelhudmenu")
        {
                string filter = string_null;
index 9c0d032432f384a60299fddc697c5b2df918ee06..df93daa6e0bcd3cacaf8fbf57d3ffdbdb0d5ba35 100644 (file)
@@ -276,8 +276,10 @@ void draw_BorderPicture(vector theOrigin, string pic, vector theSize, vector the
 }
 void draw_Text(vector theOrigin, string theText, vector theSize, vector theColor, float theAlpha, float ICanHasKallerz)
 {
-       if(theSize_x <= 0 || theSize_y <= 0)
-               error("Drawing zero size text?\n");
+       if(theSize_x <= 0 || theSize_y <= 0) {
+               dprint("Drawing zero size text?\n");
+               return;
+       }
 
        //float wi;
        //wi = draw_TextWidth(theText, ICanHasKallerz, theSize);
index 7301f5f16eab521c71104c6d321e1d492f732659..37aaeb4ab1dda7c4cf7b7493f4293a27e907c393 100644 (file)
@@ -62,8 +62,10 @@ void TextSlider_insertValue(entity me, float pos, string theString, string theId
 {
        float i;
        for (i = me.nValues; i > pos; --i)
+       {
                me.(valueStrings[i]) = me.(valueStrings[i-1]);
                me.(valueIdentifiers[i]) = me.(valueIdentifiers[i-1]);
+       }
        me.(valueStrings[pos]) = theString;
        me.(valueIdentifiers[pos]) = theIdentifier;
        me.nValues += 1;
index eb68729bad9bacc5d80e5d80b4602dea51c91192..0f2a525aa3950116eeb01914845351ccfc862ee9 100644 (file)
@@ -17,7 +17,7 @@ float menuNotTheFirstFrame;
 float menuMouseMode;
 
 float conwidth_s, conheight_s, vidwidth_s, vidheight_s, vidpixelheight_s,
-      realconwidth, realconheight, screenconwidth, screenconheight;
+      realconwidth, realconheight;
 
 void m_sync()
 {
@@ -94,11 +94,10 @@ void m_init()
 }
 
 const float MENU_ASPECT = 1.25; // 1280x1024
-const float MENU_MINHEIGHT = 600;
 
 void draw_reset_cropped()
 {
-       draw_reset(screenconwidth, screenconheight, 0.5 * (realconwidth - screenconwidth), 0.5 * (realconheight - screenconheight));
+       draw_reset(conwidth, conheight, 0.5 * (realconwidth - conwidth), 0.5 * (realconheight - conheight));
 }
 void draw_reset_full()
 {
@@ -109,7 +108,8 @@ void UpdateConWidthHeight(float w, float h, float p)
 {
        if (w != vidwidth_s || h != vidheight_s || p != vidpixelheight_s)
        {
-               updateConwidths(w, h, p);
+               if (updateConwidths(w, h, p))
+                       localcmd(sprintf("\nexec %s\n", cvar_string("menu_font_cfg")));
                vidwidth_s = w;
                vidheight_s = h;
                vidpixelheight_s = p;
@@ -130,18 +130,6 @@ void UpdateConWidthHeight(float w, float h, float p)
                conwidth = realconwidth;
                conheight = realconwidth / MENU_ASPECT;
        }
-       screenconwidth = conwidth;
-       screenconheight = conheight;
-       if(conwidth < MENU_MINHEIGHT * MENU_ASPECT)
-       {
-               conheight *= MENU_MINHEIGHT * MENU_ASPECT / conwidth;
-               conwidth = MENU_MINHEIGHT * MENU_ASPECT;
-       }
-       if(conheight < MENU_MINHEIGHT)
-       {
-               conwidth *= MENU_MINHEIGHT / conheight;
-               conheight = MENU_MINHEIGHT;
-       }
        if(main)
        {
                if(conwidth_s != conwidth || conheight_s != conheight)
index 97e17ff3c0860e6bdb0eb83c4982b6e6f1c0eb38..86cb9621c7e31d2082e45dc01bf579cfd226d757 100644 (file)
@@ -56,5 +56,3 @@ xonotic/util.qc
 ../common/monsters/monsters.qc
 
 ../warpzonelib/mathlib.qc
-
-../common/if-this-file-errors-scroll-up-and-fix-the-warnings.fteqccfail
index 37effe93256e3415ac97140777ee7bda1062669e..c14a47c9c1633c0714b3ae8054a6f5a06c56b8bd 100644 (file)
@@ -50,6 +50,10 @@ void XonoticMiscSettingsTab_fill(entity me)
                me.TD(me, 1, 1.8, e = makeXonoticTextLabel(0, _("Client UDP port:")));
                me.TD(me, 1, 1, e = makeXonoticInputBox(0, "cl_port"));
                        e.enableClearButton = 0;
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               if(cvar_type("crypto_aeslevel") & CVAR_TYPEFLAG_ENGINE)
+                       me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(2, 1, "crypto_aeslevel", _("Use encryption (AES) when available")));
        me.TR(me);
        me.TR(me);
                me.TDempty(me, 0.2);
index 8d9f2192664cfd849eb4dc0372b616c82251bd09..076dd2337494296f0c0b4b4e8d8f5c7631f11c55 100644 (file)
@@ -140,6 +140,6 @@ void XonoticVideoSettingsTab_fill(entity me)
        }
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_width $_menu_vid_width; vid_height $_menu_vid_height; vid_pixelheight $_menu_vid_pixelheight; vid_desktopfullscreen $_menu_vid_desktopfullscreen; vid_restart; menu_restart; menu_cmd videosettings", COMMANDBUTTON_APPLY));
+               me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_width $_menu_vid_width; vid_height $_menu_vid_height; vid_pixelheight $_menu_vid_pixelheight; vid_desktopfullscreen $_menu_vid_desktopfullscreen; menu_cmd update_conwidths_before_vid_restart; vid_restart; menu_cmd sync", COMMANDBUTTON_APPLY));
 }
 #endif
index 0c33e345546c9db0d85636cb7e1380f775ef3430..66f48f9e58ef2bf26f838e6736889632fe659d1a 100644 (file)
@@ -9,7 +9,7 @@ CLASS(XonoticResolutionSlider) EXTENDS(XonoticTextSlider)
        ATTRIB(XonoticResolutionSlider, vid_fullscreen, float, -1)
 ENDCLASS(XonoticResolutionSlider)
 entity makeXonoticResolutionSlider();
-void updateConwidths(float width, float height, float pixelheight);
+float updateConwidths(float width, float height, float pixelheight);
 #endif
 
 #ifdef IMPLEMENTATION
@@ -17,12 +17,16 @@ void updateConwidths(float width, float height, float pixelheight);
 /* private static */ float XonoticResolutionSlider_DataHasChanged;
 
 // Updates cvars (to be called by menu.qc at startup or on detected res change)
-void updateConwidths(float width, float height, float pixelheight)
+float updateConwidths(float width, float height, float pixelheight)
 {
        vector r, c;
        float minfactor, maxfactor;
        float sz, f;
 
+       sz = cvar("menu_vid_scale");
+       if (sz < -1)
+               return 0;  // No recalculation.
+
        // Save off current settings.
        cvar_set("_menu_vid_width", ftos(width));
        cvar_set("_menu_vid_height", ftos(height));
@@ -32,7 +36,6 @@ void updateConwidths(float width, float height, float pixelheight)
        r_x = width;
        r_y = height;
        r_z = pixelheight;
-       sz = cvar("menu_vid_scale");
 
        // calculate the base resolution
        c_z = 0;
@@ -61,9 +64,19 @@ void updateConwidths(float width, float height, float pixelheight)
                f = 1;
        c = c * f; // fteqcc fail
 
-       cvar_set("vid_conwidth", ftos(rint(c_x)));
-       cvar_set("vid_conheight", ftos(rint(c_y)));
+       c_x = rint(c_x);
+       c_y = rint(c_y);
+
+       // Please reload resolutions list and such stuff.
        XonoticResolutionSlider_DataHasChanged = TRUE;
+
+       if (c_x != cvar("vid_conwidth") || c_y != cvar("vid_conheight"))
+       {
+               cvar_set("vid_conwidth", ftos(c_x));
+               cvar_set("vid_conheight", ftos(c_y));
+               return 1;
+       }
+       return 0;
 }
 entity makeXonoticResolutionSlider()
 {
@@ -149,10 +162,12 @@ void XonoticResolutionSlider_loadResolutions(entity me, float fullscreen)
        if(me.nValues == 0)
        {
                me.addResolution(me, 640, 480, 1); // pc res
+#if 0
                me.addResolution(me, 720, 480, 1.125); // DVD NTSC 4:3
                me.addResolution(me, 720, 576, 0.9375); // DVD PAL 4:3
                me.addResolution(me, 720, 480, 0.84375); // DVD NTSC 16:9
                me.addResolution(me, 720, 576, 0.703125); // DVD PAL 16:9
+#endif
                me.addResolution(me, 800, 480, 1); // 480p at 1:1 pixel aspect
                me.addResolution(me, 800, 600, 1); // pc res
                me.addResolution(me, 1024, 600, 1); // notebook res
index f04fc8472288e11ae3b9c6e3da1a0c47e4ed6e82..53c1853a7faeeb056123eab23d3f3ab13f5812ca 100644 (file)
@@ -718,7 +718,7 @@ float CheatCommand(float argc)
        END_CHEAT_FUNCTION();
 }
 
-float Drag(entity e, float grab, float ischeat);
+float Drag(float force_allow_pick, float ischeat);
 void Drag_Begin(entity dragger, entity draggee, vector touchpoint);
 void Drag_Finish(entity dragger);
 float Drag_IsDraggable(entity draggee);
@@ -748,40 +748,11 @@ float CheatFrame()
                        {
                                // use cheat dragging if cheats are enabled
                                crosshair_trace_plusvisibletriggers(self);
-                               Drag(trace_ent, TRUE, TRUE);
+                               Drag(TRUE, TRUE);
                        }
                        else
                        {
-                               // drag is TRUE if the object can be picked up. While an object is being carried, the Drag() function
-                               // must execute for it either way, otherwise it would cause bugs if it went out of the player's trace.
-                               // This also makes sure that an object can only pe picked up if in range, but does not get dropped if
-                               // it goes out of range while slinging it around.
-
-                               float drag;
-                               crosshair_trace_plusvisibletriggers(self);
-                               drag = FALSE;
-                               if(vlen(self.origin - trace_ent.origin) <= autocvar_g_grab_range)
-                               {
-                                       switch(trace_ent.grab)
-                                       {
-                                               case 0: // can't grab
-                                                       break;
-                                               case 1: // owner can grab
-                                                       if(trace_ent.owner == self || trace_ent.realowner == self)
-                                                               drag = TRUE;
-                                                       break;
-                                               case 2: // owner and team mates can grab
-                                                       if(SAME_TEAM(trace_ent.owner, self) || SAME_TEAM(trace_ent.realowner, self) || trace_ent.team == self.team)
-                                                               drag = TRUE;
-                                                       break;
-                                               case 3: // anyone can grab
-                                                       drag = TRUE;
-                                                       break;
-                                               default:
-                                                       break;
-                                       }
-                               }
-                               Drag(trace_ent, drag, FALSE); // execute dragging
+                               Drag(FALSE, FALSE); // execute dragging
                        }
                        break;
        }
@@ -795,7 +766,7 @@ float CheatFrame()
 
 // ENTITY DRAGGING
 
-float Drag(entity e, float pick, float ischeat)
+float Drag(float force_allow_pick, float ischeat)
 {
        BEGIN_CHEAT_FUNCTION();
 
@@ -840,9 +811,42 @@ float Drag(entity e, float pick, float ischeat)
                        else
                        {
                                if(Drag_CanDrag(self))
-                                       if(self.BUTTON_DRAG && pick)
+                                       if(self.BUTTON_DRAG)
                                        {
-                                               if(e)
+                                               crosshair_trace_plusvisibletriggers(self);
+                                               entity e = trace_ent;
+                                               float pick = force_allow_pick;
+                                               if (e && !pick)
+                                               {
+                                                       // pick is TRUE if the object can be picked up. While an object is being carried, the Drag() function
+                                                       // must execute for it either way, otherwise it would cause bugs if it went out of the player's trace.
+                                                       // This also makes sure that an object can only pe picked up if in range, but does not get dropped if
+                                                       // it goes out of range while slinging it around.
+
+                                                       if(vlen(self.origin - e.origin) <= autocvar_g_grab_range)
+                                                       {
+                                                               switch(e.grab)
+                                                               {
+                                                                       case 0: // can't grab
+                                                                               break;
+                                                                       case 1: // owner can grab
+                                                                               if(e.owner == self || e.realowner == self)
+                                                                                       pick = TRUE;
+                                                                               break;
+                                                                       case 2: // owner and team mates can grab
+                                                                               if(SAME_TEAM(e.owner, self) || SAME_TEAM(e.realowner, self) || e.team == self.team)
+                                                                                       pick = TRUE;
+                                                                               break;
+                                                                       case 3: // anyone can grab
+                                                                               pick = TRUE;
+                                                                               break;
+                                                                       default:
+                                                                               break;
+                                                               }
+                                                       }
+                                               }
+                                               // Find e and pick
+                                               if(e && pick)
                                                        if(Drag_IsDraggable(e))
                                                        {
                                                                if(ischeat)
index 1c94d36505e279c8bb6b4a731bf42ec616d6efc3..0206cde6ab53dbcf8463b6d18fc5cca03e80d111 100644 (file)
@@ -441,7 +441,7 @@ void PutClientInServer (void)
                        self.ammo_fuel = warmup_start_ammo_fuel;
                        self.health = warmup_start_health;
                        self.armorvalue = warmup_start_armorvalue;
-                       self.weapons = warmup_start_weapons;
+                       self.weapons = WARMUP_START_WEAPONS;
                }
                else
                {
index f47ac57e4142a25e591759a4a9414ba16ab6d5a9..a78615633007cebde1feb0764d969bdfd02a0c40 100644 (file)
@@ -353,7 +353,10 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                ear1 += v_right * -10;
                ear2 += v_right * +10;
                d = inflictor.origin - self.origin;
-               f = (d * v_right) / vlen(d); // this is cos of angle of d and v_right!
+               if (d)
+                       f = (d * v_right) / vlen(d); // this is cos of angle of d and v_right!
+               else
+                       f = 0;  // Assum ecenter.
                force = v_right * vlen(force);
                Violence_GibSplash_At(ear1, force * -1, 2, bound(0, damage, 25) / 2 * (0.5 - 0.5 * f), self, attacker);
                Violence_GibSplash_At(ear2, force,      2, bound(0, damage, 25) / 2 * (0.5 + 0.5 * f), self, attacker);
index afe376be2efe57c017fe635bfd61c0ee8521cb74..2c631cbbbb78d70d80dc48faaf3d3812bb9b9fe4 100644 (file)
@@ -73,7 +73,8 @@ float server_is_dedicated;
 //.float       style;
 //.float       skill;
 .float sounds;
-.float  platmovetype;
+.string  platmovetype;
+.float platmovetype_start, platmovetype_end;
 
 .string killtarget;
 
@@ -471,6 +472,7 @@ void target_voicescript_clear(entity pl);
 .string target2;
 .string target3;
 .string target4;
+.string curvetarget;
 .float target_random;
 .float trigger_reverse;
 
index 02450ead176e04277603a61185548a7dc352041d..222c623720c5544a30d308c81e37b9d819a0254b 100644 (file)
@@ -128,7 +128,7 @@ void GiveFrags (entity attacker, entity targ, float f, float deathtype)
                        }
 
                        if(warmup_stage)
-                               GiveFrags_randomweapons.weapons = warmup_start_weapons;
+                               GiveFrags_randomweapons.weapons = WARMUP_START_WEAPONS;
                        else
                                GiveFrags_randomweapons.weapons = start_weapons;
 
index 6444ffdb3cec98fcf7f97114736f340c493964ef..cc6f3694b9897bd3126c826b1a3d6e964e14e505 100644 (file)
@@ -1,6 +1,5 @@
 void SUB_NullThink(void) { }
 
-void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove;
 void()  SUB_CalcMoveDone;
 void() SUB_CalcAngleMoveDone;
 //void() SUB_UseTargets;
@@ -153,6 +152,7 @@ void SUB_CalcMoveDone (void)
                self.think1 ();
 }
 
+.float platmovetype_turn;
 void SUB_CalcMove_controller_think (void)
 {
        entity oldself;
@@ -162,6 +162,7 @@ void SUB_CalcMove_controller_think (void)
        vector delta;
        vector delta2;
        vector veloc;
+       vector angloc;
        vector nextpos;
        delta = self.destvec;
        delta2 = self.destvec2;
@@ -170,23 +171,31 @@ void SUB_CalcMove_controller_think (void)
 
                traveltime = self.animstate_endtime - self.animstate_starttime;
                phasepos = (nexttick - self.animstate_starttime) / traveltime; // range: [0, 1]
-               if(self.platmovetype != 1)
-               {
-                       phasepos = 3.14159265 + (phasepos * 3.14159265); // range: [pi, 2pi]
-                       phasepos = cos(phasepos); // cos [pi, 2pi] is in [-1, 1]
-                       phasepos = phasepos + 1; // correct range to [0, 2]
-                       phasepos = phasepos / 2; // correct range to [0, 1]
-               }
+               phasepos = cubic_speedfunc(self.platmovetype_start, self.platmovetype_end, phasepos);
                nextpos = self.origin + (delta * phasepos) + (delta2 * phasepos * phasepos);
                // derivative: delta + 2 * delta2 * phasepos (e.g. for angle positioning)
 
-               if(nexttick < self.animstate_endtime) {
+               if(self.owner.platmovetype_turn)
+               {
+                       vector destangle;
+                       destangle = delta + 2 * delta2 * phasepos;
+                       destangle = vectoangles(destangle);
+                       destangle_x = -destangle_x; // flip up / down orientation
+
+                       // take the shortest distance for the angles
+                       self.owner.angles_x -= 360 * floor((self.owner.angles_x - destangle_x) / 360 + 0.5);
+                       self.owner.angles_y -= 360 * floor((self.owner.angles_y - destangle_y) / 360 + 0.5);
+                       self.owner.angles_z -= 360 * floor((self.owner.angles_z - destangle_z) / 360 + 0.5);
+                       angloc = destangle - self.owner.angles;
+                       angloc = angloc * (1 / sys_frametime); // so it arrives for the next frame
+                       self.owner.avelocity = angloc;
+               }
+               if(nexttick < self.animstate_endtime)
                        veloc = nextpos - self.owner.origin;
-                       veloc = veloc * (1 / sys_frametime); // so it arrives for the next frame
-               } else {
+               else
                        veloc = self.finaldest - self.owner.origin;
-                       veloc = veloc * (1 / sys_frametime); // so it arrives for the next frame
-               }
+               veloc = veloc * (1 / sys_frametime); // so it arrives for the next frame
+
                self.owner.velocity = veloc;
                self.nextthink = nexttick;
        } else {
@@ -211,6 +220,7 @@ void SUB_CalcMove_controller_setbezier (entity controller, vector org, vector co
 
        controller.destvec = 2 * control; // control point
        controller.destvec2 = dest - 2 * control; // quadratic part required to reach end point
+       // also: initial d/dphasepos origin = 2 * control, final speed = 2 * (dest - control)
 }
 
 void SUB_CalcMove_controller_setlinear (entity controller, vector org, vector dest)
@@ -226,7 +236,13 @@ void SUB_CalcMove_controller_setlinear (entity controller, vector org, vector de
        controller.destvec2 = '0 0 0';
 }
 
-void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeed, void() func)
+float TSPEED_TIME = -1;
+float TSPEED_LINEAR = 0;
+float TSPEED_START = 1;
+float TSPEED_END = 2;
+// TODO average too?
+
+void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeedtype, float tspeed, void() func)
 {
        float   traveltime;
        entity controller;
@@ -238,10 +254,22 @@ void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeed, void() fu
        self.finaldest = tdest;
        self.think = SUB_CalcMoveDone;
 
-       if(tspeed > 0) // positive: start speed
-               traveltime = 2 * vlen(tcontrol - self.origin) /  tspeed;
-       else // negative: end speed
-               traveltime = 2 * vlen(tcontrol - tdest)       / -tspeed;
+       switch(tspeedtype)
+       {
+               default:
+               case TSPEED_START:
+                       traveltime = 2 * vlen(tcontrol - self.origin) / tspeed;
+                       break;
+               case TSPEED_END:
+                       traveltime = 2 * vlen(tcontrol - tdest)       / tspeed;
+                       break;
+               case TSPEED_LINEAR:
+                       traveltime = vlen(tdest - self.origin)        / tspeed;
+                       break;
+               case TSPEED_TIME:
+                       traveltime = tspeed;
+                       break;
+       }
 
        if (traveltime < 0.1) // useless anim
        {
@@ -254,6 +282,8 @@ void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeed, void() fu
        controller.classname = "SUB_CalcMove_controller";
        controller.owner = self;
        controller.platmovetype = self.platmovetype;
+       controller.platmovetype_start = self.platmovetype_start;
+       controller.platmovetype_end = self.platmovetype_end;
        SUB_CalcMove_controller_setbezier(controller, self.origin, tcontrol, tdest);
        controller.finaldest = (tdest + '0 0 0.125'); // where do we want to end? Offset to overshoot a bit.
        controller.animstate_starttime = time;
@@ -271,7 +301,7 @@ void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeed, void() fu
        self = self.owner;
 }
 
-void SUB_CalcMove (vector tdest, float tspeed, void() func)
+void SUB_CalcMove (vector tdest, float tspeedtype, float tspeed, void() func)
 {
        vector  delta;
        float   traveltime;
@@ -291,13 +321,25 @@ void SUB_CalcMove (vector tdest, float tspeed, void() func)
        }
 
        delta = tdest - self.origin;
-       traveltime = vlen (delta) / tspeed;
+
+       switch(tspeedtype)
+       {
+               default:
+               case TSPEED_START:
+               case TSPEED_END:
+               case TSPEED_LINEAR:
+                       traveltime = vlen (delta) / tspeed;
+                       break;
+               case TSPEED_TIME:
+                       traveltime = tspeed;
+                       break;
+       }
 
        // Very short animations don't really show off the effect
        // of controlled animation, so let's just use linear movement.
        // Alternatively entities can choose to specify non-controlled movement.
         // The only currently implemented alternative movement is linear (value 1)
-       if (traveltime < 0.15 || self.platmovetype == 1)
+       if (traveltime < 0.15 || (self.platmovetype_start == 1 && self.platmovetype_end == 1)) // is this correct?
        {
                self.velocity = delta * (1/traveltime); // QuakeC doesn't allow vector/float division
                self.nextthink = self.ltime + traveltime;
@@ -305,17 +347,17 @@ void SUB_CalcMove (vector tdest, float tspeed, void() func)
        }
 
        // now just run like a bezier curve...
-       SUB_CalcMove_Bezier((self.origin + tdest) * 0.5, tdest, tspeed, func);
+       SUB_CalcMove_Bezier((self.origin + tdest) * 0.5, tdest, tspeedtype, tspeed, func);
 }
 
-void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeed, void() func)
+void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeedtype, float tspeed, void() func)
 {
        entity  oldself;
 
        oldself = self;
        self = ent;
 
-       SUB_CalcMove (tdest, tspeed, func);
+       SUB_CalcMove (tdest, tspeedtype, tspeed, func);
 
        self = oldself;
 }
@@ -341,7 +383,7 @@ void SUB_CalcAngleMoveDone (void)
 }
 
 // FIXME: I fixed this function only for rotation around the main axes
-void SUB_CalcAngleMove (vector destangle, float tspeed, void() func)
+void SUB_CalcAngleMove (vector destangle, float tspeedtype, float tspeed, void() func)
 {
        vector  delta;
        float   traveltime;
@@ -354,7 +396,19 @@ void SUB_CalcAngleMove (vector destangle, float tspeed, void() func)
        self.angles_y -= 360 * floor((self.angles_y - destangle_y) / 360 + 0.5);
        self.angles_z -= 360 * floor((self.angles_z - destangle_z) / 360 + 0.5);
        delta = destangle - self.angles;
-       traveltime = vlen (delta) / tspeed;
+
+       switch(tspeedtype)
+       {
+               default:
+               case TSPEED_START:
+               case TSPEED_END:
+               case TSPEED_LINEAR:
+                       traveltime = vlen (delta) / tspeed;
+                       break;
+               case TSPEED_TIME:
+                       traveltime = tspeed;
+                       break;
+       }
 
        self.think1 = func;
        self.finalangle = destangle;
@@ -371,14 +425,14 @@ void SUB_CalcAngleMove (vector destangle, float tspeed, void() func)
        self.nextthink = self.ltime + traveltime;
 }
 
-void SUB_CalcAngleMoveEnt (entity ent, vector destangle, float tspeed, void() func)
+void SUB_CalcAngleMoveEnt (entity ent, vector destangle, float tspeedtype, float tspeed, void() func)
 {
        entity  oldself;
 
        oldself = self;
        self = ent;
 
-       SUB_CalcAngleMove (destangle, tspeed, func);
+       SUB_CalcAngleMove (destangle, tspeedtype, tspeed, func);
 
        self = oldself;
 }
index 941837118766e880b16b57bf0d3546718106f6e3..42d12e951ff36a92a4c47900485dade5f5221dfb 100644 (file)
@@ -617,6 +617,7 @@ float start_armorvalue;
 WepSet warmup_start_weapons;
 WepSet warmup_start_weapons_default;
 WepSet warmup_start_weapons_defaultmask;
+#define WARMUP_START_WEAPONS ((g_warmup_allguns == 1) ? (warmup_start_weapons & (weaponsInMap | start_weapons)) : warmup_start_weapons)
 float warmup_start_ammo_shells;
 float warmup_start_ammo_nails;
 float warmup_start_ammo_rockets;
@@ -836,7 +837,7 @@ void readplayerstartcvars()
                        for (i = WEP_FIRST; i <= WEP_LAST; ++i)
                        {
                                e = get_weaponinfo(i);
-                               float w = want_weapon("g_start_weapon_", e, cvar("g_warmup_allguns"));
+                               float w = want_weapon("g_start_weapon_", e, g_warmup_allguns);
                                if(w & 1)
                                        warmup_start_weapons |= WepSet_FromWeapon(i);
                                if(w & 2)
@@ -860,10 +861,13 @@ void readplayerstartcvars()
                warmup_start_ammo_fuel = max(warmup_start_ammo_fuel, cvar("g_balance_fuel_rotstable"));
        }
 
+       WepSet precache_weapons = start_weapons;
+       if (g_warmup_allguns != 1)
+               precache_weapons |= warmup_start_weapons;
        for (i = WEP_FIRST; i <= WEP_LAST; ++i)
        {
                e = get_weaponinfo(i);
-               if((start_weapons | warmup_start_weapons) & WepSet_FromWeapon(i))
+               if(precache_weapons & WepSet_FromWeapon(i))
                        weapon_action(i, WR_PRECACHE);
        }
 
index 78b03402ce1e30f3f1ef704d320a4121fcea9921..68f465cc0da506959a4b8fda5a9563262764ea65 100644 (file)
@@ -283,5 +283,3 @@ mutators/mutator_campcheck.qc
 ../common/test.qc
 ../common/util.qc
 ../common/notifications.qc
-
-../common/if-this-file-errors-scroll-up-and-fix-the-warnings.fteqccfail
index 24da476d72bad18cb5d19089a883492b98d392c5..97ae43e1e838d8129ea1c1435c54d86b12ea52f9 100644 (file)
@@ -83,14 +83,14 @@ void plat_go_down()
 {
        sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM);
        self.state = 3;
-       SUB_CalcMove (self.pos2, self.speed, plat_hit_bottom);
+       SUB_CalcMove (self.pos2, TSPEED_LINEAR, self.speed, plat_hit_bottom);
 }
 
 void plat_go_up()
 {
        sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM);
        self.state = 4;
-       SUB_CalcMove (self.pos1, self.speed, plat_hit_top);
+       SUB_CalcMove (self.pos1, TSPEED_LINEAR, self.speed, plat_hit_top);
 }
 
 void plat_center_touch()
@@ -177,7 +177,43 @@ void plat_reset()
        }
 }
 
-void spawnfunc_path_corner() { }
+.float platmovetype_start_default, platmovetype_end_default;
+float set_platmovetype(entity e, string s)
+{
+       // sets platmovetype_start and platmovetype_end based on a string consisting of two values
+
+       float n;
+       n = tokenize_console(s);
+       if(n > 0)
+               e.platmovetype_start = stof(argv(0));
+       else
+               e.platmovetype_start = 0;
+
+       if(n > 1)
+               e.platmovetype_end = stof(argv(1));
+       else
+               e.platmovetype_end = e.platmovetype_start;
+
+       if(n > 2)
+               if(argv(2) == "force")
+                       return TRUE; // no checking, return immediately
+
+       if(!cubic_speedfunc_is_sane(e.platmovetype_start, e.platmovetype_end))
+       {
+               objerror("Invalid platform move type; platform would go in reverse, which is not allowed.");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+void spawnfunc_path_corner()
+{
+       // setup values for overriding train movement
+       // if a second value does not exist, both start and end speeds are the single value specified
+       if(!set_platmovetype(self, self.platmovetype))
+               return;
+}
 void spawnfunc_func_plat()
 {
        if (self.sounds == 0)
@@ -246,15 +282,49 @@ void spawnfunc_func_plat()
        plat_spawn_inside_trigger ();   // the "start moving" trigger
 }
 
-
+.float train_wait_turning;
 void() train_next;
 void train_wait()
 {
+       entity oldself;
+       oldself = self;
+       self = self.enemy;
+       SUB_UseTargets();
+       self = oldself;
+       self.enemy = world;
+
+       // if turning is enabled, the train will turn toward the next point while waiting
+       if(self.platmovetype_turn && !self.train_wait_turning)
+       {
+               entity targ, cp;
+               vector ang;
+               targ = find(world, targetname, self.target);
+               if((self.spawnflags & 1) && targ.curvetarget)
+                       cp = find(world, targetname, targ.curvetarget);
+               else
+                       cp = world;
+
+               if(cp) // bezier curves movement
+                       ang = cp.origin - (self.origin - self.view_ofs); // use the origin of the control point of the next path_corner
+               else // linear movement
+                       ang = targ.origin - (self.origin - self.view_ofs); // use the origin of the next path_corner
+               ang = vectoangles(ang);
+               ang_x = -ang_x; // flip up / down orientation
+
+               if(self.wait > 0) // slow turning
+                       SUB_CalcAngleMove(ang, TSPEED_TIME, self.ltime - time + self.wait, train_wait);
+               else // instant turning
+                       SUB_CalcAngleMove(ang, TSPEED_TIME, 0.0000001, train_wait);
+               self.train_wait_turning = TRUE;
+               return;
+       }
+
        if(self.noise != "")
                stopsoundto(MSG_BROADCAST, self, CH_TRIGGER_SINGLE); // send this as unreliable only, as the train will resume operation shortly anyway
 
-       if(self.wait < 0)
+       if(self.wait < 0 || self.train_wait_turning) // no waiting or we already waited while turning
        {
+               self.train_wait_turning = FALSE;
                train_next();
        }
        else
@@ -262,31 +332,56 @@ void train_wait()
                self.think = train_next;
                self.nextthink = self.ltime + self.wait;
        }
-
-       entity oldself;
-       oldself = self;
-       self = self.enemy;
-       SUB_UseTargets();
-       self = oldself;
-       self.enemy = world;
 }
 
 void train_next()
 {
-       entity targ;
+       entity targ, cp = world;
+       vector cp_org = '0 0 0';
+
        targ = find(world, targetname, self.target);
-       self.enemy = targ;
        self.target = targ.target;
+       if (self.spawnflags & 1)
+       {
+               if(targ.curvetarget)
+               {
+                       cp = find(world, targetname, targ.curvetarget); // get its second target (the control point)
+                       cp_org = cp.origin - self.view_ofs; // no control point found, assume a straight line to the destination
+               }
+       }
        if (self.target == "")
                objerror("train_next: no next target");
        self.wait = targ.wait;
        if (!self.wait)
                self.wait = 0.1;
 
+       if(targ.platmovetype)
+       {
+               // this path_corner contains a movetype overrider, apply it
+               self.platmovetype_start = targ.platmovetype_start;
+               self.platmovetype_end = targ.platmovetype_end;
+       }
+       else
+       {
+               // this path_corner doesn't contain a movetype overrider, use the train's defaults
+               self.platmovetype_start = self.platmovetype_start_default;
+               self.platmovetype_end = self.platmovetype_end_default;
+       }
+
        if (targ.speed)
-               SUB_CalcMove(targ.origin - self.mins, targ.speed, train_wait);
+       {
+               if (cp)
+                       SUB_CalcMove_Bezier(cp_org, targ.origin - self.view_ofs, TSPEED_LINEAR, targ.speed, train_wait);
+               else
+                       SUB_CalcMove(targ.origin - self.view_ofs, TSPEED_LINEAR, targ.speed, train_wait);
+       }
        else
-               SUB_CalcMove(targ.origin - self.mins, self.speed, train_wait);
+       {
+               if (cp)
+                       SUB_CalcMove_Bezier(cp_org, targ.origin - self.view_ofs, TSPEED_LINEAR, self.speed, train_wait);
+               else
+                       SUB_CalcMove(targ.origin - self.view_ofs, TSPEED_LINEAR, self.speed, train_wait);
+       }
 
        if(self.noise != "")
                sound(self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_IDLE);
@@ -299,7 +394,7 @@ void func_train_find()
        self.target = targ.target;
        if (self.target == "")
                objerror("func_train_find: no next target");
-       setorigin(self, targ.origin - self.mins);
+       setorigin(self, targ.origin - self.view_ofs);
        self.nextthink = self.ltime + 1;
        self.think = train_next;
 }
@@ -319,6 +414,14 @@ void spawnfunc_func_train()
        if (!self.speed)
                self.speed = 100;
 
+       if (self.spawnflags & 2)
+       {
+               self.platmovetype_turn = TRUE;
+               self.view_ofs = '0 0 0'; // don't offset a rotating train, origin works differently now
+       }
+       else
+               self.view_ofs = self.mins;
+
        if not(InitMovingBrushTrigger())
                return;
        self.effects |= EF_LOWPRECISION;
@@ -335,6 +438,11 @@ void spawnfunc_func_train()
                self.dmgtime = 0.25;
        self.dmgtime2 = time;
 
+       if(!set_platmovetype(self, self.platmovetype))
+               return;
+       self.platmovetype_start_default = self.platmovetype_start;
+       self.platmovetype_end_default = self.platmovetype_end;
+
        // TODO make a reset function for this one
 }
 
@@ -597,7 +705,7 @@ void button_done()
 void button_return()
 {
        self.state = STATE_DOWN;
-       SUB_CalcMove (self.pos1, self.speed, button_done);
+       SUB_CalcMove (self.pos1, TSPEED_LINEAR, self.speed, button_done);
        self.frame = 0;                 // use normal textures
        if (self.health)
                self.takedamage = DAMAGE_YES;   // can be shot again
@@ -622,7 +730,7 @@ void button_fire()
                sound (self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
 
        self.state = STATE_UP;
-       SUB_CalcMove (self.pos2, self.speed, button_wait);
+       SUB_CalcMove (self.pos2, TSPEED_LINEAR, self.speed, button_wait);
 }
 
 void button_reset()
@@ -846,7 +954,7 @@ void door_go_down()
        }
 
        self.state = STATE_DOWN;
-       SUB_CalcMove (self.pos1, self.speed, door_hit_bottom);
+       SUB_CalcMove (self.pos1, TSPEED_LINEAR, self.speed, door_hit_bottom);
 }
 
 void door_go_up()
@@ -863,7 +971,7 @@ void door_go_up()
        if (self.noise2 != "")
                sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
        self.state = STATE_UP;
-       SUB_CalcMove (self.pos2, self.speed, door_hit_top);
+       SUB_CalcMove (self.pos2, TSPEED_LINEAR, self.speed, door_hit_top);
 
        string oldmessage;
        oldmessage = self.message;
@@ -1148,7 +1256,7 @@ void door_rotating_go_down()
        }
 
        self.state = STATE_DOWN;
-       SUB_CalcAngleMove (self.pos1, self.speed, door_rotating_hit_bottom);
+       SUB_CalcAngleMove (self.pos1, TSPEED_LINEAR, self.speed, door_rotating_hit_bottom);
 }
 
 void door_rotating_go_up()
@@ -1164,7 +1272,7 @@ void door_rotating_go_up()
        if (self.noise2 != "")
                sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
        self.state = STATE_UP;
-       SUB_CalcAngleMove (self.pos2, self.speed, door_rotating_hit_top);
+       SUB_CalcAngleMove (self.pos2, TSPEED_LINEAR, self.speed, door_rotating_hit_top);
 
        string oldmessage;
        oldmessage = self.message;
@@ -1639,7 +1747,7 @@ void fd_secret_use()
                self.dest1 = self.origin + v_right * (self.t_width * temp);
 
        self.dest2 = self.dest1 + v_forward * self.t_length;
-       SUB_CalcMove(self.dest1, self.speed, fd_secret_move1);
+       SUB_CalcMove(self.dest1, TSPEED_LINEAR, self.speed, fd_secret_move1);
        if (self.noise2 != "")
                sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
 }
@@ -1663,7 +1771,7 @@ void fd_secret_move2()
 {
        if (self.noise2 != "")
                sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
-       SUB_CalcMove(self.dest2, self.speed, fd_secret_move3);
+       SUB_CalcMove(self.dest2, TSPEED_LINEAR, self.speed, fd_secret_move3);
 }
 
 // Wait here until time to go back...
@@ -1683,7 +1791,7 @@ void fd_secret_move4()
 {
        if (self.noise2 != "")
                sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
-       SUB_CalcMove(self.dest1, self.speed, fd_secret_move5);
+       SUB_CalcMove(self.dest1, TSPEED_LINEAR, self.speed, fd_secret_move5);
 }
 
 // Wait 1 second...
@@ -1699,7 +1807,7 @@ void fd_secret_move6()
 {
        if (self.noise2 != "")
                sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
-       SUB_CalcMove(self.oldorigin, self.speed, fd_secret_done);
+       SUB_CalcMove(self.oldorigin, TSPEED_LINEAR, self.speed, fd_secret_done);
 }
 
 void fd_secret_done()