VM_freepic, // #319 void(string name) freepic (EXT_CSQC)
VM_drawcharacter, // #320 float(vector position, float character, vector scale, vector rgb, float alpha, float flag) drawcharacter (EXT_CSQC)
VM_drawstring, // #321 float(vector position, string text, vector scale, vector rgb, float alpha[, float flag]) drawstring (EXT_CSQC, DP_CSQC)
-VM_drawpic, // #322 float(vector position, string pic, vector size, vector rgb, float alpha, float flag) drawpic (EXT_CSQC)
+VM_drawpic, // #322 float(vector position, string pic, vector size, vector rgb, float alpha[, float flag]) drawpic (EXT_CSQC)
VM_drawfill, // #323 float(vector position, vector size, vector rgb, float alpha, float flag) drawfill (EXT_CSQC)
VM_drawsetcliparea, // #324 void(float x, float y, float width, float height) drawsetcliparea
VM_drawresetcliparea, // #325 void(void) drawresetcliparea
{
const char *picname;
float *size, *pos, *rgb;
- int flag;
+ int flag = 0;
- VM_SAFEPARMCOUNT(6,VM_drawpic);
+ VM_SAFEPARMCOUNTRANGE(5,6,VM_drawpic);
picname = PRVM_G_STRING(OFS_PARM1);
VM_CheckEmptyString (picname);
pos = PRVM_G_VECTOR(OFS_PARM0);
size = PRVM_G_VECTOR(OFS_PARM2);
rgb = PRVM_G_VECTOR(OFS_PARM3);
- flag = (int) PRVM_G_FLOAT(OFS_PARM5);
+ if (prog->argc >= 6)
+ flag = (int) PRVM_G_FLOAT(OFS_PARM5);
if(flag < DRAWFLAG_NORMAL || flag >=DRAWFLAG_NUMFLAGS)
{