Fix bug with randomv intrinsic.
This commit is contained in:
parent
f0e57311d6
commit
a1bf9dd60a
4 changed files with 5 additions and 5 deletions
|
@ -2475,7 +2475,7 @@ static struct {
|
|||
{"sin", PF_Sin, 38},
|
||||
{"cos", PF_Cos, 39},
|
||||
{"sqrt", PF_Sqrt, 40},
|
||||
{"randomvector", PF_randomvector, 41},
|
||||
{"randomvec", PF_randomvector, 41},
|
||||
{"registercvar", PF_registercvar, 42},
|
||||
{"min", PF_min, 43},
|
||||
{"max", PF_max, 44},
|
||||
|
|
|
@ -370,7 +370,6 @@ void QCBUILTIN PF_cvars_haveunsaved (pubprogfuncs_t *prinst, struct globalvars_s
|
|||
void QCBUILTIN PF_cvar_set (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void QCBUILTIN PF_cvar_setf (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void QCBUILTIN PF_ArgC (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void QCBUILTIN PF_randomvec (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void QCBUILTIN PF_strreplace (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void QCBUILTIN PF_strireplace (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void QCBUILTIN PF_randomvector (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
|
|
|
@ -2045,7 +2045,7 @@ static QCC_sref_t QCC_SupplyConversion(QCC_sref_t var, etype_t wanted, pbool fa
|
|||
if (o == 0) //type already matches
|
||||
return var;
|
||||
if (flag_typeexplicit)// && !QCC_SRef_IsNull(var))
|
||||
QCC_PR_ParseErrorPrintSRef(ERR_TYPEMISMATCH, var, "Implicit type mismatch. Needed %s, got %s.", basictypenames[wanted], basictypenames[var.cast->type]);
|
||||
QCC_PR_ParseErrorPrintSRef(ERR_TYPEMISMATCH, var, "Automatic type conversions disabled. Needed %s, got %s.", basictypenames[wanted], basictypenames[var.cast->type]);
|
||||
if (o < 0)
|
||||
{
|
||||
if (fatal && wanted != ev_variant && var.cast->type != ev_variant)
|
||||
|
@ -7926,6 +7926,7 @@ static QCC_sref_t QCC_PR_ParseFunctionCall (QCC_ref_t *funcref) //warning, the f
|
|||
if (scale.cast)
|
||||
{
|
||||
QCC_PR_SimpleStatement(&pr_opcodes[OP_MUL_F], x, scale, x, false);
|
||||
scale.sym->referenced = true;
|
||||
scale.ofs--;
|
||||
scale.cast = type_vector;
|
||||
QCC_FreeTemp(scale);
|
||||
|
|
|
@ -11243,7 +11243,7 @@ static BuiltinList_t BuiltinList[] = { //nq qw h2 ebfs
|
|||
{"sin", PF_Fixme, 0, 0, 0, 38, "float(float)"},
|
||||
{"cos", PF_Fixme, 0, 0, 0, 39, "float(float)"},
|
||||
{"sqrt", PF_Fixme, 0, 0, 0, 40, "float(float)"},
|
||||
{"randomvector", PF_Fixme, 0, 0, 0, 41, "vector()"},
|
||||
{"randomvec", PF_Fixme, 0, 0, 0, 41, D("vector()", "Returns a random vector with length <= 1 (each axis may be negative).")},
|
||||
{"registercvar", PF_Fixme, 0, 0, 0, 42, D("float(string name, string value, optional float flags)", "Creates the cvar if it didn't already exist. This presents issues for setting those cvars via startup configs of course, and autocvars are easier but I suppose they don't get any flags (which are ignored anyway, of course).")},
|
||||
{"min", PF_Fixme, 0, 0, 0, 43, "float(float,...)"},
|
||||
{"max", PF_Fixme, 0, 0, 0, 44, "float(float,...)"},
|
||||
|
@ -11571,7 +11571,7 @@ static BuiltinList_t BuiltinList[] = { //nq qw h2 ebfs
|
|||
|
||||
{"tracebox", PF_traceboxdp, 0, 0, 0, 90, D("void(vector start, vector mins, vector maxs, vector end, float nomonsters, entity ent)", "Exactly like traceline, but a box instead of a uselessly thin point. Acceptable sizes are limited by bsp format, q1bsp has strict acceptable size values.")},
|
||||
|
||||
{"randomvec", PF_randomvector, 0, 0, 0, 91, D("vector()", "Returns a vector with random values. Each axis is independantly a value between -1 and 1 inclusive.")},
|
||||
{"randomvec", PF_randomvector, 0, 0, 0, 91, D("vector()", "Returns a random vector with length <= 1 (each axis may be negative).")},
|
||||
{"getlight", PF_sv_getlight, 0, 0, 0, 92, D("DEP_SSQC(\"Broken on dedicated servers, ignores rtlights/etc\") vector(vector org)", "Computes the RGB lighting at the specified position.")},// (DP_QC_GETLIGHT),
|
||||
{"registercvar", PF_registercvar, 0, 0, 0, 93, D("float(string cvarname, string defaultvalue, optional float flags)", "Creates a new cvar on the fly. If it does not already exist, it will be given the specified value. If it does exist, this is a no-op.\nThis builtin has the limitation that it does not apply to configs or commandlines. Such configs will need to use the set or seta command causing this builtin to be a noop.\nIn engines that support it, you will generally find the autocvar feature easier and more efficient to use.")},
|
||||
{"min", PF_min, 0, 0, 0, 94, D("float(float a, float b, ...)", "Returns the lowest value of its arguments.")},// (DP_QC_MINMAXBOUND)
|
||||
|
|
Loading…
Reference in a new issue