Hi!
I have here a piece of code.
Problem: In a custom levels (Dead Reckoning), the ghost is not created. When I add a while(gh==-1) around the creation of the ghost object, the game freezes. Could someone tell me, why my ghost ain't being created?
/Edward
I have here a piece of code.
Code:
pulse:
if(GetThingSector(GetLocalPlayerThing())!=prev)
{
SetCameraFocus(1,GetLocalPlayerThing());
if(gh!=-1) DestroyThing(gh);
gh=-1;
vertexpos=GetSectorVertexPos(GetThingSector(GetLocalPlayerThing()), rand()*GetNumSectorVertices(GetThingSector(GetLocalPlayerThing())));
thevertex=VectorAdd(vertexpos, VectorScale(VectorNorm(VectorSub(GetSectorCenter(GetThingSector(GetLocalPlayerThing())), vertexpos)), 0.1));
gh=CreateThingAtPos(g,GetThingSector(GetLocalPlayerThing()),thevertex,'0 0 0');
CaptureThing(gh);
}
prev=GetThingSector(GetLocalPlayerThing());
lv=VectorSub(GetThingPos(gh),GetThingPos(GetLocalPlayerThing()));
lvr=VectorSet(-VectorX(lv),-VectorY(lv),-VectorZ(lv));
SetThingLook(gh,lvr);
SetCameraFocus(1,gh);
return;Problem: In a custom levels (Dead Reckoning), the ghost is not created. When I add a while(gh==-1) around the creation of the ghost object, the game freezes. Could someone tell me, why my ghost ain't being created?
/Edward
