Illegal Exception (SOLVED)

Started by Akumayo, Sat 06/05/2006 16:45:07

Previous topic - Next topic

Akumayo

Quote
---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x0046B345 ; program pointer is +6, ACI version 2.71.894, gtags (1,11)

AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and notify CJ on the Tech forum.

in Global script (line 150)
from Global script (line 233)


Most versions of Windows allow you to press Ctrl+C now to copy this entire message to the clipboard for easy reporting.
---------------------------
OK   
---------------------------

Global Script line 150:
Code: ags

Display("%d, %s | %d, %s", AI_Unit, Unit[AI_Unit].Team, Bogey, Unit[Bogey].Team);


Global Script line 233 runs the function that line 150 is contained in.

What have I done this time?

-Thanks in advance, Akumayo
"Power is not a means - it is an end."

Scorpiorus

Is Unit[...].Team a String?

If it is, make sure you've assigned an actual text to it first, because it would just be a null-pointer otherwise (that is Unit[...].Team == null).

So...

Unit[...].Team = ""; // before using it

Akumayo

OMG, this was such a stupid mistake...  I'm used to casting %s because of .Name being a string.  Thanks for clearing it up, .Team IS an integer, afterall.  Thanks again, sorry to post such a silly mistake  :-[
"Power is not a means - it is an end."

SMF spam blocked by CleanTalk