Esempio n. 1
0
void
setupworld ( world_t *world )
{
	int i;
	entity_t *e;
	vector2d_t angle,dir,verts[2];
	
	world->time = SDL_GetTicks();
	
	if(!world->playerentity)
	{
		if(!spawnplayer( world ))
			return;
	}
	for(i=0;i<world->numentities;i++)
	{
		e = &world->entities[i];
		
		if(e->think && world->time > e->nextthink)
		{
			void (*think)(world_t *w, struct entity_s *e);
			think = e->think;
			e->think = NULL;
			think(world,e);
		}
		
		/* don't need to add transparent stuff to the world */
		if(!e->texture)
			continue;
		if(e->follow)
			setfollowangle(world,e,&angle);
		else
			vectorcopy(&angle,&e->angle);

		vectorrot90( &angle, &dir );
		vectorscale( &dir, e->texture->width/2, &dir );
		vectorsubtract( &e->pos, &dir, &verts[0]);
		vectoradd( &e->pos, &dir, &verts[1]);
		
		addsprite(world->raycaster,verts,e->texture->height,e->vpos,
				SURFACE_NONE,e->texture);
	}

	/* copy over player view pos to raycaster */
	world->raycaster->currentplatform = world->playerentity->currentplatform;
	vectorcopy(&world->raycaster->viewpos,&world->playerentity->pos);
	vectorcopy(&world->raycaster->viewdir,&world->playerentity->angle);
	world->raycaster->eyelevel = world->playerentity->vpos+VIEW_HEIGHT;
}
 void respawnself()
 {
     if(ispaused()) return;
     if(m_mp(gamemode))
     {
         int seq = (player1->lifesequence<<16)|((lastmillis/1000)&0xFFFF);
         if(player1->respawned!=seq) { addmsg(N_TRYSPAWN, "rc", player1); player1->respawned = seq; }
     }
     else
     {
         spawnplayer(player1);
         showscores(false);
         lasthit = 0;
         if(cmode) cmode->respawned(player1);
     }
 }
Esempio n. 3
0
void CACBot::Spawn()
{
    // Init all bot variabeles
    m_pMyEnt->nextprimary = 2 + rnd(5); // 2011jan18:ft: 2 == GUN_CARBINE, GUN_SHOTGUN, GUN_SUBGUN, GUN_SNIPER, GUN_ASSAULT - if CPISTOL is activated this needs a FIXME to rnd(6)
    m_pMyEnt->targetyaw = m_pMyEnt->targetpitch = 0.0f;
    m_pMyEnt->pBot = this;

    spawnplayer(m_pMyEnt);

    m_eCurrentBotState = STATE_NORMAL;
     m_iShootDelay = m_iChangeWeaponDelay = 0;
     m_iCheckEnvDelay = 0;
     m_vPrevOrigin = g_vecZero;
     m_iStuckCheckDelay = lastmillis + 250;
     m_bStuck = false;
     m_iStuckTime = 0;
     m_iStrafeTime = m_iStrafeCheckDelay = 0;
     m_iMoveDir = DIR_NONE;

     m_pPrevEnemy = NULL;
     m_iCombatNavTime = 0;
     m_iSPMoveTime = 0;
     m_iEnemySearchDelay = 0;
     m_bCombatJump = false;
     m_iCombatJumpDelay = 0;
     m_iHuntDelay = 0;
     m_vHuntLocation = m_vPrevHuntLocation = g_vecZero;
     m_pHuntTarget = NULL;
     m_fPrevHuntDist = 0.0f;
     m_iHuntLastTurnLessTime = m_iHuntPlayerUpdateTime = m_iHuntPauseTime = 0;

     m_iLastJumpPad = 0;
     m_pTargetEnt = NULL;
     m_iCheckTeleporterDelay = m_iCheckJumppadsDelay = 0;
     m_iCheckEntsDelay = 0;
     m_iCheckTriggersDelay = 0;
     m_iLookForWaypointTime = 0;

     m_iAimDelay = 0;
     m_fYawToTurn = m_fPitchToTurn = 0.0f;

     m_vGoal = m_vWaterGoal = g_vecZero;

     ResetWaypointVars();
}
Esempio n. 4
0
 void respawnself()
 {
     if(paused || ispaused()) return;
     if(m_mp(gamemode))
     {
         if(player1->respawned!=player1->lifesequence)
         {
             addmsg(N_TRYSPAWN, "rc", player1);
             player1->respawned = player1->lifesequence;
         }
     }
     else
     {
         spawnplayer(player1);
         showscores(false);
         lasthit = 0;
         if(cmode) cmode->respawned(player1);
     }
 }
Esempio n. 5
0
static void respawnself() {
  spawnplayer(player1);
  showscores(false);
}
Esempio n. 6
0
 void respawnself()
 {
     spawnplayer(player1);
 }