Support shotgun_speed 0

for mapping stationary bullets
This commit is contained in:
def 2019-11-27 18:18:48 +01:00
parent c0eb81f603
commit 9d39ca888f
3 changed files with 5 additions and 2 deletions

View file

@ -77,6 +77,9 @@ typedef vector2_base<int> ivec2;
template<typename T>
inline vector2_base<T> closest_point_on_line(vector2_base<T> line_point0, vector2_base<T> line_point1, vector2_base<T> target_point)
{
if(line_point1 == line_point0)
return line_point0;
vector2_base<T> c = target_point - line_point0;
vector2_base<T> v = (line_point1 - line_point0);
v = normalize(v);

View file

@ -214,7 +214,7 @@ void CGameWorld::Tick()
CCharacter *CGameWorld::IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, vec2& NewPos, CCharacter *pNotThis, int CollideWith, class CCharacter *pThisOnly)
{
// Find other players
float ClosestLen = distance(Pos0, Pos1) * 100.0f;
float ClosestLen = HUGE_VALF;
CCharacter *pClosest = 0;
CCharacter *p = (CCharacter *)FindFirst(ENTTYPE_CHARACTER);

View file

@ -295,7 +295,7 @@ void CGameWorld::Tick()
CCharacter *CGameWorld::IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, vec2& NewPos, CCharacter *pNotThis, int CollideWith, class CCharacter *pThisOnly)
{
// Find other players
float ClosestLen = distance(Pos0, Pos1) * 100.0f;
float ClosestLen = HUGE_VALF;
CCharacter *pClosest = 0;
CCharacter *p = (CCharacter *)FindFirst(ENTTYPE_CHARACTER);