]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
-Fixed a minor bug in CL_Video
authorblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 5 Dec 2004 13:58:16 +0000 (13:58 +0000)
committerblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 5 Dec 2004 13:58:16 +0000 (13:58 +0000)
-Changed func_t from int to unsigned int - probably this breaks some things
 but at least it fixes an annoying crash of the DP with the current Nexuiz
 build.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4829 d7cf8633-e32d-0410-b094-e92efae38249

cl_video.c
pr_comp.h
pr_execprogram.h

index 7707dd77e96fceca59c288eb0e79ae45297a917b..2d6069e69c01a822bedbf98a71263fc17bc54373 100644 (file)
@@ -208,7 +208,7 @@ void CL_VideoFrame( void ) // update all videos
                        if( realtime - video->lasttime > CLTHRESHOLD )
                                SuspendVideo( video );
                        else if( video->state == CLVIDEO_PAUSE )
-                               video->starttime = realtime + video->framenum * video->framerate;
+                               video->starttime = realtime - video->framenum * video->framerate;
                        else 
                                VideoFrame( video );
 
index 6b35e5c15629352bad8344326b00a89cc2599442..7a744645669fa785d49d721c059f4f07587eda88 100644 (file)
--- a/pr_comp.h
+++ b/pr_comp.h
@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #ifndef PR_COMP_H
 #define PR_COMP_H
 
-typedef int    func_t;
+typedef unsigned int   func_t;
 typedef int    string_t;
 
 typedef enum {ev_void, ev_string, ev_float, ev_vector, ev_entity, ev_field, ev_function, ev_pointer} etype_t;
index e0e9d24ea2bc9782d95b44b0b7a365b032c18ab4..5089e27577f3edf0de80852fb0f58db309171446 100644 (file)
                                startprofile = profile;
                                pr_xstatement = st - pr_statements;
                                pr_argc = st->op - OP_CALL0;
-                               if (!OPA->function)
+                               if (!OPA->function )
                                        Host_Error("NULL function");
+                               else if (OPA->function > (unsigned) progs->numfunctions)
+                                       Host_Error("Bad function number");
 
                                newf = &pr_functions[OPA->function];