1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
int collisionhandler::checkexplode(collarea *area,int good)
{
printf("In collisionhandler, checkexplode ,players.size(): %i\n",(int)players.size());
int s=0;
if(internal_ptr<players.size())
{
int found=0;
while((internal_ptr<players.size())&&!found)
{
printf("In collisionhandler, checkexplode while loop, internal_ptr: %i\n",internal_ptr);
if((players[internal_ptr].good==(!good))&&(internal_ptr<players.size()))
{
found=1;
}
else
{
internal_ptr++;
}
}
if(found)
{
fprintf(stdout,"collisionhandler, checkexplode, found is true. internal_ptr: %i\n",internal_ptr);
s=1;
area = playerarea[!good];
fprintf(stdout,"area: %p, playerarea[!good]: %p\n",area,playerarea[!good]);
fprintf(stdout,"x: %f, y: %f, theta: %f\n",players[internal_ptr].x,players[internal_ptr].y,players[internal_ptr].theta);
area->setarea(players[internal_ptr].x,players[internal_ptr].y,players[internal_ptr].theta);
internal_ptr++;
}
else
{
internal_ptr=0;
}
}
else
{
internal_ptr=0;
}
fprintf(stdout,"in checkexplode, area: %p, s: %i\n",area,s);
return s;
}
|