Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/game/chars/CCharNPCAct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1243,14 +1243,14 @@ void CChar::NPC_Act_Wander()
uint uiLookAroundChance = pTagOverride
? (uint)pTagOverride->GetValNum()
: g_Cfg.m_iNPCWanderLookAroundChance;
uiLookAroundChance = maximum(uiLookAroundChance, 100);
uiLookAroundChance = minimum(uiLookAroundChance, 100);

//if ( !(uiRand % (2u + TICKS_PER_SEC/2)) )
if (uiRand >= uiLookAroundChance)
if (uiRand < uiLookAroundChance)
{
// NPC_LookAround() is very expensive, so since NPC_Act_Wander is called every tick for every char with ACTION == NPCACT_WANDER,
// don't look around every time.
if ( NPC_LookAround() )
if (NPC_LookAround())
iStopWandering = 2; // I'm stopping to wander because I have seen something interesting.
}

Expand Down