summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/GameInitDispose.cpp77
1 files changed, 38 insertions, 39 deletions
diff --git a/src/GameInitDispose.cpp b/src/GameInitDispose.cpp
index d99eeee..c11f3c1 100644
--- a/src/GameInitDispose.cpp
+++ b/src/GameInitDispose.cpp
@@ -850,6 +850,7 @@ void Game::InitGame()
 	camera.position.z=num_blocks/2*block_spacing+block_spacing/2;
 	camera.position.y=30;
 	camera.oldposition=camera.position;
+	numpeople=1;
 
 	//Setup path to walk around blocks
 	path.load((unsigned char *)":Data:Models:path.solid");
@@ -863,53 +864,51 @@ void Game::InitGame()
 	person[0].speedmult=1.3;
 
 	//Add vip
-	auto vip = person[1];
-	vip.playerrotation=0;
-	vip.whichcostume=vipcostume;
-	vip.whichblockx=((person[0].playercoords.x+block_spacing/2)/block_spacing);
-	vip.whichblocky=((person[0].playercoords.x+block_spacing/2)/block_spacing);
-	vip.pathnum=-1;
-	vip.oldpathnum=-1;
-	vip.oldoldpathnum=-1;
-	vip.oldoldoldpathnum=-1;
-
-	while (vip.pathnum < 0
-	       || vip.pathnum >= path.vertexNum
-	       || vip.pathnum == 1)
-		vip.pathnum = Random() % path.vertexNum;
-
-	vip.pathtarget.x=path.vertex[vip.pathnum].x;
-	vip.pathtarget.z=path.vertex[vip.pathnum].z;
-	vip.pathsize=.98+float(abs(Random()%20))/400;
-	vip.pathtarget*=vip.pathsize;
-	vip.pathtarget.x+=vip.whichblockx*block_spacing;
-	vip.pathtarget.z+=vip.whichblocky*block_spacing;
-	vip.playercoords=vip.pathtarget;
-	vip.oldplayercoords=vip.playercoords;
-
-	person[0].playercoords=vip.playercoords;
+	person[numpeople].playerrotation=0;
+	person[numpeople].whichcostume=vipcostume;
+	person[numpeople].whichblockx=((person[0].playercoords.x+block_spacing/2)/block_spacing);
+	person[numpeople].whichblocky=((person[0].playercoords.x+block_spacing/2)/block_spacing);
+	person[numpeople].pathnum=-1;
+	person[numpeople].oldpathnum=-1;
+	person[numpeople].oldoldpathnum=-1;
+	person[numpeople].oldoldoldpathnum=-1;
+
+	while(person[numpeople].pathnum<0||person[numpeople].pathnum>=path.vertexNum||person[numpeople].pathnum==1){
+		person[numpeople].pathnum=Random()%path.vertexNum;
+	}
+
+	person[numpeople].pathtarget.x=path.vertex[person[numpeople].pathnum].x;
+	person[numpeople].pathtarget.z=path.vertex[person[numpeople].pathnum].z;
+	person[numpeople].pathsize=.98+float(abs(Random()%20))/400;
+	person[numpeople].pathtarget*=person[numpeople].pathsize;
+	person[numpeople].pathtarget.x+=person[numpeople].whichblockx*block_spacing;
+	person[numpeople].pathtarget.z+=person[numpeople].whichblocky*block_spacing;
+	person[numpeople].playercoords=person[numpeople].pathtarget;
+	person[numpeople].oldplayercoords=person[numpeople].playercoords;
+
+	person[0].playercoords=person[numpeople].playercoords;
 	person[0].playercoords.x+=1;
 	person[0].playercoords.z+=1;
 	person[0].oldplayercoords=person[0].playercoords;
 
-	vip.skeleton.free=0;
-	vip.targetanimation=walkanim;
-	vip.speed=1;
-	vip.existing=0;
-	vip.speedmult=1;
-	if(type==zombie_type)vip.speedmult=.8;
+	person[numpeople].skeleton.free=0;
+	person[numpeople].targetanimation=walkanim;
+	person[numpeople].speed=1;
+	person[numpeople].existing=0;
+	person[numpeople].speedmult=1;
+	if(type==zombie_type)person[numpeople].speedmult=.8;
 
-	vip.health=100;
-	vip.playerrotation2=0;//20;
-	vip.lastdistancevictim=200000;
+	person[numpeople].health=100;
+	person[numpeople].playerrotation2=0;//20;
+	person[numpeople].lastdistancevictim=200000;
 
-	if(vip.skeleton.broken)vip.skeleton.Load((char *)":Data:Skeleton:Basic Figure");
+	if(person[numpeople].skeleton.broken)person[numpeople].skeleton.Load((char *)":Data:Skeleton:Basic Figure");
 
-	vip.type=viptype;
-	vip.whichgun=nogun; vip.aiming=0; vip.killtarget=-1;
-	vip.existing=1;
+	person[numpeople].type=viptype;
+	person[numpeople].whichgun=nogun; person[numpeople].aiming=0; person[numpeople].killtarget=-1;
+	person[numpeople].existing=1;
 
-	citypeoplenum[vip.whichblockx][vip.whichblocky]++;
+	citypeoplenum[person[numpeople].whichblockx][person[numpeople].whichblocky]++;
 	numpeople++;
 	spawndelay=.1;