mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-02 22:11:22 +00:00
PF_vlen: add casts to double to force 64-bit precision
Fixes https://sourceforge.net/p/quakespasm/bugs/26/ (travail qte1m2.bsp button near 2772 767 -584 hurting the player sm179_otp.bsp: left button causing the player to get stuck) This change should probably be applied to more places in pr_cmds.c and elsewhere, but this specific change is enough to fix these corner cases git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1554 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
77a45cbbbe
commit
a89063a5ff
1 changed files with 2 additions and 2 deletions
|
@ -427,11 +427,11 @@ scalar vlen(vector)
|
|||
static void PF_vlen (void)
|
||||
{
|
||||
float *value1;
|
||||
float new_temp;
|
||||
double new_temp;
|
||||
|
||||
value1 = G_VECTOR(OFS_PARM0);
|
||||
|
||||
new_temp = value1[0] * value1[0] + value1[1] * value1[1] + value1[2]*value1[2];
|
||||
new_temp = (double)value1[0] * value1[0] + (double)value1[1] * value1[1] + (double)value1[2]*value1[2];
|
||||
new_temp = sqrt(new_temp);
|
||||
|
||||
G_FLOAT(OFS_RETURN) = new_temp;
|
||||
|
|
Loading…
Reference in a new issue