If add the following function to my program, it isn't even being called yet;
function LoadNextPath(TempID)
For zz=1 to 42
if Departures(zz).ModelID = TempID
TempCNTR=zz
ObjID = Departures(zz).ModelID
SegNo = Departures(zz).SegmentNo+1
Departures(zz).SegmentNo = SegNo
PthName$ = Departures(zz).Rootpathname
goto SkipAhead2
endif
next zz
SkipAhead2:
PathCounter = PathCounter+1
AI Make Path PathCounter
`restore the base path to get its name
restoreBasePath(PthName$)
`read the # of segments in this path
Read SegmentCount
if SegNo>SegmentCount
`it is timeto request takeoff
Commoutput("[SYS] time for takeoff...")
endif
`check to see if the next segment is less than all of the segments
If SegNo<=SegmentCount
for zz=1 to SegNo
Read TmpSegment$
next zz
endif
`restore the next segment to be used
RestorePathSegment(TmpSegment$)
read pts
if pts = 0
commoutput("[SYS] SOMETHING IS WRONG!")
goto ExitHere2
endif
for zz=1 to pts
read x1#, y1#
`make the first points the location of the departure
x1# = x1# * 0.33
y1# = y1# * 0.33
if zz=pts
Departures(TempCNTR).StopX = x1#
Departures(TempCNTR).StopY = y1#
Departures(TempCNTR).PBCreated = 1
Departures(TempCNTR).Stage = 21
endif
`====================================
if zz>1
AI Path Add Point PathCounter,x1#,y1#
endif
Next zz
AI Entity Assign Patrol Path ObjID, PathCounter
ExitHere2:
endfunction
It produces a crash with a report of the following:
Problem signature:
Problem Event Name: APPCRASH
Application Name: towercab.exe
Application Version: 1.0.0.0
Application Timestamp: 4d460aea
Fault Module Name: ntdll.dll
Fault Module Version: 6.1.7601.18247
Fault Module Timestamp: 521ea91c
Exception Code: c0000005
Exception Offset: 00052ca9
OS Version: 6.1.7601.2.1.0.256.1
Locale ID: 1033
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt
If I comment out this function, the program runs just fine. I have tried adding in one line at a time until an error is encountered. And when it does happen, there is absolutely no reason for it. The only thing that appears to cause the problem is the DARK AI commands.
Is there anything here in the code jumping out to anyone else?