if(this.spawnflags & SPAWNFLAG_NO_WAYPOINTS_FOR_ITEMS)
bot_waypoints_for_items = 0;
- precache();
-
WaypointSprite_Init();
GameLogInit(); // prepare everything
MapVote_Start();
}
-/*
-============
-FindIntermission
-
-Returns the entity to view from
-============
-*/
-/*
-entity FindIntermission()
-{
- local entity spot;
- local float cyc;
-
-// look for info_intermission first
- spot = find(NULL, classname, "info_intermission");
- if (spot)
- { // pick a random one
- cyc = random() * 4;
- while (cyc > 1)
- {
- spot = find(spot, classname, "info_intermission");
- if (!spot)
- spot = find(spot, classname, "info_intermission");
- cyc = cyc - 1;
- }
- return spot;
- }
-
-// then look for the start position
- spot = find(NULL, classname, "info_player_start");
- if (spot)
- return spot;
-
-// testinfo_player_start is only found in regioned levels
- spot = find(NULL, classname, "testplayerstart");
- if (spot)
- return spot;
-
-// then look for the start position
- spot = find(NULL, classname, "info_player_deathmatch");
- if (spot)
- return spot;
-
- //objerror ("FindIntermission: no spot");
- return NULL;
-}
-*/
-
/*
===============================================================================
FOREACH_WORD(s, true, { precache_playermodel(it); });
}
-void precache()
+PRECACHE(PlayerModels)
{
- // gamemode related things
-
// Precache all player models if desired
if (autocvar_sv_precacheplayermodels)
{
precache_playermodels(autocvar_sv_defaultplayermodel_pink);
precache_playermodels(autocvar_sv_defaultplayermodel);
}
-
-#if 0
- // Disabled this code because it simply does not work (e.g. ignores bgmvolume, overlaps with "cd loop" controlled tracks).
-
- if (!this.noise && this.music) // quake 3 uses the music field
- this.noise = this.music;
-
- // plays music for the level if there is any
- if (this.noise)
- {
- precache_sound (this.noise);
- ambientsound ('0 0 0', this.noise, VOL_BASE, ATTEN_NONE);
- }
-#endif
}
string playername(entity p, bool team_colorize);
-void precache();
-
void remove_safely(entity e);
void remove_unsafely(entity e);
float PlayerEdgeDistance(entity p, vector v)
{
- vector vbest;
-
- if(v.x < 0) vbest.x = p.mins.x; else vbest.x = p.maxs.x;
- if(v.y < 0) vbest.y = p.mins.y; else vbest.y = p.maxs.y;
- if(v.z < 0) vbest.z = p.mins.z; else vbest.z = p.maxs.z;
+ vector vbest = vec3(
+ ((v.x < 0) ? p.mins.x : p.maxs.x),
+ ((v.y < 0) ? p.mins.y : p.maxs.y),
+ ((v.z < 0) ? p.mins.z : p.maxs.z));
return vbest * v;
}