prvm_prog_t *prog = CLVM_prog;
CSQC_BEGIN
PRVM_clientglobalfloat(time) = cl.time;
+ PRVM_clientglobalfloat(cltime) = realtime; // Spike named it that way.
PRVM_clientglobalfloat(frametime) = frametime;
PRVM_clientglobalfloat(servercommandframe) = cls.servermovesequence;
PRVM_clientglobalfloat(clientcommandframe) = cl.movecmd[0].sequence;
//idea: tZork
//darkplaces implementation: tZork, divVerent
//constant definitions:
-float GETTIME_FRAMESTART = 0; // time of start of frame
-float GETTIME_REALTIME = 1; // current time (may be OS specific)
+float GETTIME_FRAMESTART = 0; // time of start of frame relative to an arbitrary point in time
+float GETTIME_REALTIME = 1; // current absolute time (OS specific)
float GETTIME_HIRES = 2; // like REALTIME, but may reset between QC invocations and thus can be higher precision
-float GETTIME_UPTIME = 3; // time since start of the engine
+float GETTIME_UPTIME = 3; // time of start of frame since start of the engine
//builtin definitions:
float(float tmr) gettime = #519;
//description:
//builtin definitions:
string(string filename) whichpack = #503;
//description:
-//returns the name of the pak/pk3/whatever containing the given file, in the same path space as FRIK_FILE functions use (that is, possibly with a path name prefix)
+//for files in a pak/pk3/whatever, returns the pack's file name in FRIK_FILE name space.
+//for physical files, returns "".
+//in case of error, returns string_null.
//DP_QC_URI_ESCAPE
//idea: divVerent
searchpath_t *sp = FS_FindFile(filename, &index, true);
if(sp && sp->pack)
return sp->pack->shortname;
+ else if(sp)
+ return "";
else
return 0;
}
fn = PRVM_G_STRING(OFS_PARM0);
pack = FS_WhichPack(fn);
- PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(prog, pack ? pack : "");
+ PRVM_G_INT(OFS_RETURN) = pack ? PRVM_SetTempString(prog, pack) : 0;
}
typedef struct
PRVM_DECLARE_clientglobaledict(trace_ent)
PRVM_DECLARE_clientglobaledict(world)
PRVM_DECLARE_clientglobalfloat(clientcommandframe)
+PRVM_DECLARE_clientglobalfloat(cltime)
PRVM_DECLARE_clientglobalfloat(coop)
PRVM_DECLARE_clientglobalfloat(deathmatch)
PRVM_DECLARE_clientglobalfloat(dmg_save)
PRVM_DECLARE_function(main)
PRVM_DECLARE_global(SV_InitCmd)
PRVM_DECLARE_global(clientcommandframe)
+PRVM_DECLARE_global(cltime)
PRVM_DECLARE_global(coop)
PRVM_DECLARE_global(deathmatch)
PRVM_DECLARE_global(dmg_origin)