theory 1:
1 of the element to crash JK is to set a view on something that does not exist. Somehow when you SetCameraFocus, the target thing is no longer valid.
theory 2:
Destroying an invalid thing (which will have 0 assigned and which will usually point to the player himself) will destroy the player and crash the game.
I think it's probably the second reason with DestoryThing having "camera" invalid.
I suggest you to put the
if(camera != -1) DestroyThing(camera);
before the FireProjectiles, so it always destroys the 1 before, only when creating a new one.
Also in order to avoid the first theory, if you have some kind of timer set in the camera_tpl template, you might want to get rid of it as if it gets destroyed automatically by timer, SetCameraFocus can crash JK. If you don't have it, that's ok.
comment:
Don't know why I just said, it's not possible for JK
Sorry. Haven't been coding cog for months and months.
Using ParseArg may not be so dangerous as if you apply ParseArg in this code, it still works.
But if you can get around with these solutions, that should be fine too.
------------------
http://millennium.massassi.net/ - Millennium
[This message has been edited by Hideki (edited August 16, 2001).]