Skip to content

Commit

Permalink
Fixed warnings and coverity download being picky and case sensitive.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbnolok committed Oct 19, 2023
1 parent d09b2f0 commit b19d063
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverity-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
TOKEN: ${{ secrets.COVERITY_TOKEN }}
#echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
run: |
wget -nv https://scan.coverity.com/download/cxx/linux64 --post-data "token=${TOKEN}&project=SphereServer/Source-X" -O cov-analysis-linux64.tar.gz
wget -nv https://scan.coverity.com/download/cxx/linux64 --post-data "token=${TOKEN}&project=Sphereserver/Source-X" -O cov-analysis-linux64.tar.gz
mkdir cov-analysis-linux64
tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64
export PATH=`pwd`/cov-analysis-linux64/bin:$PATH
Expand Down
14 changes: 7 additions & 7 deletions src/game/CWorldMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ const CServerMapBlock* CWorldMap::GetMapBlock(const CPointMap& pt) // static
block->m_CacheTime.HitCacheTime();
return block.get();
}

// else load and add it to the cache.
block = std::make_unique<CServerMapBlock>(iBx, iBy, pt.m_map);
ASSERT(block);
Expand Down Expand Up @@ -860,7 +860,7 @@ CPointMap CWorldMap::FindItemTypeNearby(const CPointMap & pt, IT_TYPE iType, int

if (fLimitZ) //Checking if we are in the same floor.
{

if (pMultiItem->m_dz != z2)
continue;
/*
Expand Down Expand Up @@ -1446,7 +1446,7 @@ void CWorldMap::GetHeightPoint(const CPointMap & pt, CServerMapBlockState & bloc
dwBlockThis = 0;
// Terrain height is screwed. Since it is related to all the terrain around it.
std::optional<CUOMapMeter> pMapTop = GetMapMeterAdjusted(pt); //Get pMapTop Z Adjusted.
//const CUOMapMeter* pMapTop = pMapBlock->GetTerrain(UO_BLOCK_OFFSET(pt.m_x), UO_BLOCK_OFFSET(pt.m_y));
//const CUOMapMeter* pMapTop = pMapBlock->GetTerrain(UO_BLOCK_OFFSET(pt.m_x), UO_BLOCK_OFFSET(pt.m_y));
if (!pMapTop)
return;
//DEBUG_ERR(("pMeter->m_wTerrainIndex 0%x dwBlockThis (0%x)\n",pMeter->m_wTerrainIndex,dwBlockThis));
Expand Down Expand Up @@ -1487,14 +1487,14 @@ void CWorldMap::GetHeightPoint(const CPointMap & pt, CServerMapBlockState & bloc
}
}

const char CWorldMap::GetFloorAvarage(char pPoint1, char pPoint2, short iAverage)
char CWorldMap::GetFloorAvarage(char pPoint1, char pPoint2, short iAverage)
{
//We can't use char here, because higher points like hills has 64+ heights and adding 64+65 each other exceed char limit and causes returns minus values.
const short pTotal = pPoint1 + pPoint2, pHalf = pTotal / 2, pEven = pTotal % 2, pAverage = iAverage - pHalf;
return static_cast<char>(pHalf + (pEven != 0 && pAverage > 5));
}

const short CWorldMap::GetAreaAverage(char pTop, char pLeft, char pBottom, char pRight)
short CWorldMap::GetAreaAverage(char pTop, char pLeft, char pBottom, char pRight)
{
const short iHighest1 = maximum(pTop, pBottom);
const short iLowest1 = minimum(pTop, pBottom);
Expand All @@ -1504,7 +1504,7 @@ const short CWorldMap::GetAreaAverage(char pTop, char pLeft, char pBottom, char
return maximum(iHighest1, iHighest2) - minimum(iLowest1, iLowest2);
}

const CUOMapMeter CWorldMap::CheckMapTerrain(CUOMapMeter pDefault, short x, short y, uchar map)
CUOMapMeter CWorldMap::CheckMapTerrain(CUOMapMeter pDefault, short x, short y, uchar map)
{
CPointMap pt = { x, y, 0, map };
const CServerMapBlock* pMapBlock = GetMapBlock(pt);
Expand Down Expand Up @@ -1790,7 +1790,7 @@ CWorldSearch::CWorldSearch(const CPointMap& pt, int iDist) :
_fInertToggle = false;
_pObj = nullptr;
_idxObj = _idxObjMax = 0;

_pSectorBase = _pSector = pt.GetSector();

_rectSector.SetRect(
Expand Down
6 changes: 3 additions & 3 deletions src/game/CWorldMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class CWorldMap
static const CUOMapMeter* GetMapMeter(const CPointMap& pt); // Height of MAP0.MUL at given coordinates

static std::optional<CUOMapMeter> GetMapMeterAdjusted(const CPointMap& pt);
static const CUOMapMeter CheckMapTerrain(CUOMapMeter pDefault, short x, short y, uchar map);
static const char GetFloorAvarage(char pPoint1, char pPoint2, short iAverage);
static const short GetAreaAverage(char pTop, char pLeft, char pBottom, char pRight);
static CUOMapMeter CheckMapTerrain(CUOMapMeter pDefault, short x, short y, uchar map);
static char GetFloorAvarage(char pPoint1, char pPoint2, short iAverage);
static short GetAreaAverage(char pTop, char pLeft, char pBottom, char pRight);

static CItemTypeDef* GetTerrainItemTypeDef(dword dwIndex);
static IT_TYPE GetTerrainItemType(dword dwIndex);
Expand Down

0 comments on commit b19d063

Please sign in to comment.