brainAI\scripts\enterArea\generic.src bug?

Archive of posts related to former distro versions. Be aware that posts here do not refer to the current distro and may not work.
Locked
Lagoon
Grandmaster Poster
Posts: 118
Joined: Sun Mar 05, 2006 7:25 am

brainAI\scripts\enterArea\generic.src bug?

Post by Lagoon »

097\Distro\pkg\mobiles\brainAI\scripts\enterArea\generic.src

Line 33

Code: Select all

function EnteredArea(npc, byref event, byref settings, byref scripts)
	var source := event.source;
	
	if ( NPC_ShouldWatch(npc, source, settings, scripts) )
		if ( NPC_AddToWatchList(npc, source) )
			AI_WakeUp(npc);
			
			if ( scripts["LookAround"] )
				if ( !GetNerveProcess(npc, "LookAround") )
					AI_WakeUp(npc);
				endif
			endif
			
			return 1;
		endif
	endif
	
	return 0;
endfunction
There's something strange, I see no use in the code block

Code: Select all

			if ( scripts["LookAround"] )
				if ( !GetNerveProcess(npc, "LookAround") )
					AI_WakeUp(npc);
				endif
			endif
when there's already a

Code: Select all

			AI_WakeUp(npc);
Maybe you wanted to wakeup only when the LookAround nerve isn't running and you forgot to remove the first wakeup?
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Post by Austin »

Fixed.
Was related to a bug that existed with sleeping, until Abner found it.
Locked