mirror of
https://git.code.sf.net/p/quake/prozac-qfcc
synced 2024-11-10 07:11:51 +00:00
rewrite crossproduct so it actually gives a cross product and fix the one
call of it so the end result is the same
This commit is contained in:
parent
b743ed605b
commit
2f0c2eec2f
3 changed files with 8 additions and 6 deletions
|
@ -14,7 +14,7 @@ void() JobCrusader =
|
|||
self.StatusRefreshTime = time + 1;
|
||||
};
|
||||
|
||||
float(vector veca, vector vecb) crossproduct;
|
||||
vector(vector veca, vector vecb) crossproduct;
|
||||
|
||||
entity (entity crusader) Crusader_FindIdiot =
|
||||
{
|
||||
|
|
8
tfort.qc
8
tfort.qc
|
@ -3949,11 +3949,13 @@ void() PlayerObserverMode =
|
|||
|
||||
//============================================================================
|
||||
// Return the crossproduct of 2 vectors
|
||||
float(vector veca, vector vecb) crossproduct =
|
||||
vector(vector veca, vector vecb) crossproduct =
|
||||
{
|
||||
local float result;
|
||||
local vector result;
|
||||
|
||||
result = (veca_x * vecb_y) - (vecb_x * veca_y);
|
||||
result_x = (veca_y * vecb_z) - (vecb_y * veca_z);
|
||||
result_y = (veca_z * vecb_x) - (vecb_z * veca_x);
|
||||
result_z = (veca_x * vecb_y) - (vecb_x * veca_y);
|
||||
return result;
|
||||
};
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ void (entity targ, entity inflictor, entity attacker, float damage, float T_flag
|
|||
void () player_run;
|
||||
void(entity bomb, entity attacker, float rad, entity ignore) T_RadiusDamage;
|
||||
void() TeamFortress_DisplayDetectionItems;
|
||||
float(vector veca, vector vecb) crossproduct;
|
||||
vector(vector veca, vector vecb) crossproduct;
|
||||
void(vector org, float damage) SpawnBlood;
|
||||
void(entity rhook) Reset_Grapple;
|
||||
void() SuperDamageSound;
|
||||
|
@ -323,7 +323,7 @@ void() W_FireAxe =
|
|||
makevectors(self.angles);
|
||||
|
||||
// Backstab
|
||||
if (crossproduct(def,v_forward) > 0)
|
||||
if ((crossproduct(def,v_forward) * '0 0 1') > 0)
|
||||
{
|
||||
deathmsg = DMSG_BACKSTAB;
|
||||
ThrowGib("progs/gib1.mdl", -50);
|
||||
|
|
Loading…
Reference in a new issue