]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cd_shared.c
physics: fix and refactor unsticking
[xonotic/darkplaces.git] / cd_shared.c
index b5b520007593171cbc6db44bff65bf0421a601de..389675f80395cf66dceede7da6c3fde86ea1f9d5 100644 (file)
@@ -122,7 +122,7 @@ static void CDAudio_Play_byName (const char *trackname, qbool looping, qbool try
        sfx_t* sfx;
        char filename[MAX_QPATH];
 
-       Host_StartVideo();
+       CL_StartVideo();
 
        if (!enabled)
                return;
@@ -275,7 +275,7 @@ static void CD_f(cmd_state_t *cmd)
        command = Cmd_Argv(cmd, 1);
 
        if (strcasecmp(command, "remap") != 0)
-               Host_StartVideo();
+               CL_StartVideo();
 
        if (strcasecmp(command, "on") == 0)
        {
@@ -321,7 +321,7 @@ static void CD_f(cmd_state_t *cmd)
                        return;
                }
                for (n = 1; n <= ret; n++)
-                       strlcpy(remap[n], Cmd_Argv(cmd, n+1), sizeof(*remap));
+                       dp_strlcpy(remap[n], Cmd_Argv(cmd, n+1), sizeof(*remap));
 #endif
                return;
        }
@@ -417,12 +417,12 @@ static void CDAudio_SetVolume (float newvol)
                return;
 
        // If the CD has been muted
-       if (newvol == 0.0f)
+       if (newvol <= 0.0f)
                CDAudio_Pause ();
        else
        {
                // If the CD has been unmuted
-               if (cdvolume == 0.0f)
+               if (cdvolume <= 0.0f)
                        CDAudio_Resume ();
 
                if (faketrack != -1)
@@ -473,7 +473,7 @@ static void CDAudio_StartPlaylist(qbool resume)
                                        break;
                                // if we don't find the desired track, use the first one
                                if (count == 0)
-                                       strlcpy(trackname, com_token, sizeof(trackname));
+                                       dp_strlcpy(trackname, com_token, sizeof(trackname));
                        }
                }
                if (count > 0)
@@ -503,7 +503,7 @@ static void CDAudio_StartPlaylist(qbool resume)
                                                break;
                                        if (listindex == current)
                                        {
-                                               strlcpy(trackname, com_token, sizeof(trackname));
+                                               dp_strlcpy(trackname, com_token, sizeof(trackname));
                                                break;
                                        }
                                }