Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: "Wayne K. Werner" Newsgroups: scea.yaroze.programming.codewarrior Subject: Survival demo Date: 25 Aug 1997 03:09:26 GMT Organization: WermX Software Lines: 32 Message-ID: <01bcb104$2433eea0$70bf43ce@wkwerner> NNTP-Posting-Host: port12.con2.com X-Newsreader: Microsoft Internet News 4.70.1161 Didn't know where to post this, so I did it here... In converting the survival demo over to CW, I go a warning that the local variable short i is used before it is initialized. This is indeed the case, in the function HandleEnmyCollision() at line 1814 of main.c: static short HandleEnmyCollision(OBJECT *objc, short *dx, short *dy, short *dz) { short i, slabid, ballid, enmyid, roboid; short where_onwall, where_onslab, where_onball, where_onenmy, where_onrobo; short state = objc->State; /* Check the collision of the object with robot */ roboid = -1; where_onrobo = HandleObjcCollision(objc, &Robo, dx, dy, dz); if (where_onrobo & COLLISION_XYZ) { if ((Robo.Pos.coord.t[1] - Robo.DifY) <= this is the offending line: (Enmy[i].Pos.coord.t[1] - Enmy[i].DifY + (*dy))) roboid = 0; else roboid = 1; } What is the legitamate initialization value? Thanks, Wayne K. Werner wkwerner@con2.com