Fixed bullet to player hit-testing routine
This commit is contained in:
parent
2deaf3ffa6
commit
9b0bc2d1a2
@ -412,7 +412,7 @@ namespace spades {
|
|||||||
hitFlag = 0;
|
hitFlag = 0;
|
||||||
}
|
}
|
||||||
hitPlayerDistance = dist;
|
hitPlayerDistance = dist;
|
||||||
hitFlag |= 1; // head
|
hitFlag = 1; // head
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(hb.torso.RayCast(muzzle, dir, &hitPos)) {
|
if(hb.torso.RayCast(muzzle, dir, &hitPos)) {
|
||||||
@ -424,7 +424,7 @@ namespace spades {
|
|||||||
hitFlag = 0;
|
hitFlag = 0;
|
||||||
}
|
}
|
||||||
hitPlayerDistance = dist;
|
hitPlayerDistance = dist;
|
||||||
hitFlag |= 2; // torso
|
hitFlag = 2; // torso
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(int j = 0; j < 3 ;j++){
|
for(int j = 0; j < 3 ;j++){
|
||||||
@ -438,9 +438,9 @@ namespace spades {
|
|||||||
}
|
}
|
||||||
hitPlayerDistance = dist;
|
hitPlayerDistance = dist;
|
||||||
if(j == 2)
|
if(j == 2)
|
||||||
hitFlag |= 8; // arms
|
hitFlag = 8; // arms
|
||||||
else
|
else
|
||||||
hitFlag |= 4; // leg
|
hitFlag = 4; // leg
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user