Skip to content
This repository has been archived by the owner on Jul 27, 2020. It is now read-only.

Commit

Permalink
Core:
Browse files Browse the repository at this point in the history
* removed another double if procedure to fix any further potential errors.
* fixed a pragma error, the original method not only was incorrect but also did not work

Signed-off-by: Bootz <bootz@projectskyfire.org>
  • Loading branch information
Bootz committed Jan 21, 2014
1 parent 3e09076 commit 9d316a5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
4 changes: 1 addition & 3 deletions dep/acelite/ace/Map_Manager.cpp
Expand Up @@ -496,9 +496,7 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::resize_i (ACE_UINT32 new_size)
ENTRY *temp = 0;

// Allocate new memory.
ACE_ALLOCATOR_RETURN (temp,
(ENTRY *) this->allocator_->malloc (new_size * sizeof (ENTRY)),
-1);
ACE_ALLOCATOR_RETURN (temp, (ENTRY *) this->allocator_->malloc(new_size * sizeof (ENTRY)), -1);

// Copy over the occupied entires.
for (i = this->occupied_list_.next ();
Expand Down
6 changes: 3 additions & 3 deletions src/server/collision/Pathfinding/PathInfo.cpp
Expand Up @@ -411,7 +411,7 @@ void PathInfo::BuildPolyPath(PathNode startPos, PathNode endPos)

if (!m_polyLength || dtResult != DT_SUCCESS)
{
// only happens if we passed bad data to findPath(), or navmesh is messed up
///- only happens if we passed bad data to findPath(), or navmesh is messed up
sLog->outError("%u's Path Build failed: 0 length path", m_sourceUnit->GetGUID());
BuildShortcut();
m_type = PATHFIND_NOPATH;
Expand Down Expand Up @@ -439,7 +439,7 @@ void PathInfo::BuildPointPath(float *startPoint, float *endPoint)
if ((m_type & PATHFIND_INCOMPLETE) && DT_SUCCESS == m_navMeshQuery->closestPointOnPoly(m_pathPolyRefs[m_polyLength-1], endPoint, closestPoint))
{
dtVcopy(endPoint, closestPoint);
setActualEndPosition(PathNode(endPoint[2],endPoint[0],endPoint[1]));
setActualEndPosition(PathNode (endPoint[2], endPoint[0], endPoint[1]));
}

float pathPoints[MAX_POINT_PATH_LENGTH*VERTEX_SIZE];
Expand Down Expand Up @@ -588,7 +588,7 @@ uint32 PathInfo::fixupCorridor(dtPolyRef* path, const uint32 npath, const uint32
// Adjust beginning of the buffer to include the visited.
uint32 req = nvisited - furthestVisited;
uint32 orig = uint32(furthestPath+1) < npath ? furthestPath+1 : npath;
uint32 size = npath-orig > 0 ? npath-orig : 0;
uint32 size = npath-orig > 0 ? npath-orig : 0; // 'npath - orig > o' will work as 'npath != orig' as well.
if (req+size > maxPath)
size = maxPath-req;

Expand Down
9 changes: 4 additions & 5 deletions src/server/game/AI/CreatureAI.cpp
Expand Up @@ -63,21 +63,20 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToN
{
if (Unit* nearTarget = creature->SelectNearestTarget(maxRangeToNearestTarget))
creature->AI()->AttackStart(nearTarget);
else if (creature->isSummon())
else
if (creature->isSummon())
{
if (Unit* summoner = creature->ToTempSummon()->GetSummoner())
{
Unit* target = summoner->getAttackerForHelper();

if (!target && summoner->CanHaveThreatList() && !summoner->getThreatManager().isThreatListEmpty())
target = summoner->getThreatManager().getHostilTarget();

if (target && (creature->IsFriendlyTo(summoner) || creature->IsHostileTo(target)))
creature->AI()->AttackStart(target);
}
}
}

if (!creature->HasReactState(REACT_PASSIVE) && !creature->getVictim())
{
sLog->outError("DoZoneInCombat called for creature that has empty threat list (creature entry = %u)", creature->GetEntry());
return;
}
Expand Down
6 changes: 4 additions & 2 deletions src/server/game/Accounts/AccountMgr.cpp
Expand Up @@ -237,12 +237,14 @@ bool normalizeString(std::string& utf8String)
size_t maxLength = MAX_ACCOUNT_STR;
if (!Utf8toWStr(utf8String, buffer, maxLength))
return false;

#ifdef _MSC_VER
#pragma warning(disable: 4996)
# pragma warning(push)
# pragma warning(disable:4996)
#endif
std::transform(&buffer[0], buffer+maxLength, &buffer[0], wcharToUpperOnlyLatin);
#ifdef _MSC_VER
#pragma warning(default: 4996)
# pragma warning(pop)
#endif

return WStrToUtf8(buffer, maxLength, utf8String);
Expand Down

0 comments on commit 9d316a5

Please sign in to comment.