Skip to content

Commit

Permalink
Fix #5235
Browse files Browse the repository at this point in the history
revert thread unsafe changes in IsBlockedNoSpeedModCheck.
  • Loading branch information
ashdnazg committed May 15, 2016
1 parent abdc30e commit 9ba9e97
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
6 changes: 0 additions & 6 deletions rts/Sim/MoveTypes/MoveMath/MoveMath.cpp
Expand Up @@ -115,19 +115,13 @@ CMoveMath::BlockType CMoveMath::IsBlockedNoSpeedModCheck(const MoveDef& moveDef,
return BLOCK_IMPASSABLE;

const int xstep = 2, zstep = 2;
const int tempNum = gs->GetTempNum();

// (footprints are point-symmetric around <xSquare, zSquare>)
for (int z = zmin; z <= zmax; z += zstep) {
const int zOffset = z * mapDims.mapx;
for (int x = xmin; x <= xmax; x += xstep) {
const BlockingMapCell& cell = groundBlockingObjectMap->GetCellUnsafeConst(zOffset + x);
for (CSolidObject* collidee: cell) {
if (collidee->tempNum == tempNum)
continue;

collidee->tempNum = tempNum;

ret |= ObjectBlockType(moveDef, collidee, collider);
if (ret & BLOCK_STRUCTURE)
return ret;
Expand Down
2 changes: 1 addition & 1 deletion rts/Sim/Path/Default/PathConstants.h
Expand Up @@ -26,7 +26,7 @@ static const float MEDRES_SEARCH_DISTANCE_EXT = (MEDRES_SEARCH_DISTANCE * 0.4f)
// how many recursive refinement attempts NextWayPoint should make
static const unsigned int MAX_PATH_REFINEMENT_DEPTH = 4;

static const unsigned int PATHESTIMATOR_VERSION = 77;
static const unsigned int PATHESTIMATOR_VERSION = 78;

static const unsigned int MEDRES_PE_BLOCKSIZE = 8;
static const unsigned int LOWRES_PE_BLOCKSIZE = 32;
Expand Down
5 changes: 3 additions & 2 deletions rts/Sim/Path/Default/PathEstimator.cpp
Expand Up @@ -874,8 +874,9 @@ void CPathEstimator::WriteFile(const std::string& cacheFileName, const std::stri
zipWriteInFileInZip(file, (void*) &hash, 4);

// Write block-center-offsets.
for (int pathType = 0; pathType < moveDefHandler->GetNumMoveDefs(); ++pathType)
zipWriteInFileInZip(file, (void*) &blockStates.peNodeOffsets[pathType][0], blockStates.GetSize() * sizeof(short2));
for (int pathType = 0; pathType < moveDefHandler->GetNumMoveDefs(); ++pathType) {
zipWriteInFileInZip(file, (void*) &blockStates.peNodeOffsets[pathType][0], blockStates.peNodeOffsets[pathType].size() * sizeof(short2));
}

// Write vertices.
zipWriteInFileInZip(file, &vertexCosts[0], vertexCosts.size() * sizeof(float));
Expand Down

0 comments on commit 9ba9e97

Please sign in to comment.