Skip to content
Permalink
Browse files

fix qf crash

  • Loading branch information...
rtri
rtri committed Sep 5, 2019
1 parent 5201229 commit 26d93c7dc451b22bbac8896034eb3073689fa021
Showing with 5 additions and 0 deletions.
  1. +5 −0 rts/Sim/Misc/QuadField.cpp
@@ -309,6 +309,8 @@ void CQuadField::GetQuadsOnRay(QuadFieldQuery& qfq, const float3& start, const f
#ifndef UNIT_TEST
bool CQuadField::InsertUnitIf(CUnit* unit, const float3& wpos)
{
assert(unit != nullptr);

const int wposQuadIdx = WorldPosToQuadFieldIdx(wpos);
const int uposQuadIdx = WorldPosToQuadFieldIdx(unit->pos);

@@ -327,6 +329,9 @@ bool CQuadField::InsertUnitIf(CUnit* unit, const float3& wpos)

bool CQuadField::RemoveUnitIf(CUnit* unit, const float3& wpos)
{
if (unit == nullptr)
return false;

const int wposQuadIdx = WorldPosToQuadFieldIdx(wpos);
const int uposQuadIdx = WorldPosToQuadFieldIdx(unit->pos);

0 comments on commit 26d93c7

Please sign in to comment.
You can’t perform that action at this time.