DistributeEvenly_amount -= f;
return f;
}
+float DistributeEvenly_GetRandomized(float weight)
+{
+ float f;
+ if (weight <= 0)
+ return 0;
+ f = floor(random() + DistributeEvenly_amount * weight / DistributeEvenly_totalweight);
+ DistributeEvenly_totalweight -= weight;
+ DistributeEvenly_amount -= f;
+ return f;
+}
#define move_out_of_solid(e) WarpZoneLib_MoveOutOfSolid(e)
#define FOR_EACH_CLIENT(v) FOR_EACH_CLIENTSLOT(v) if(v.flags & FL_CLIENT)
#define FOR_EACH_REALCLIENT(v) FOR_EACH_CLIENT(v) if(clienttype(v) == CLIENTTYPE_REAL)
#define FOR_EACH_PLAYER(v) FOR_EACH_CLIENT(v) if(v.classname == STR_PLAYER)
+#define FOR_EACH_SPEC(v) FOR_EACH_CLIENT(v) if(v.classname != STR_PLAYER)
#define FOR_EACH_REALPLAYER(v) FOR_EACH_REALCLIENT(v) if(v.classname == STR_PLAYER)
#endif
+#define CENTER_OR_VIEWOFS(ent) (ent.origin + ((ent.classname == STR_PLAYER) ? ent.view_ofs : ((ent.mins + ent.maxs) * 0.5)))
+
// copies a string to a tempstring (so one can strunzone it)
string strcat1(string s) = #115; // FRIK_FILE
else replacement = "batteries"; // ;)
} else if (escape == "x") {
replacement = cursor_ent.netname;
- if (!replacement || !cursor_ent)
+ if (replacement == "" || !cursor_ent)
replacement = "nothing";
} else if (escape == "s")
replacement = ftos(vlen(self.velocity - self.velocity_z * '0 0 1'));
if(!(g_lms || g_ca))
start_items |= IT_UNLIMITED_AMMO;
}
- else if (g_minstagib)
- {
- g_pinata = 0; // incompatible
- g_weapon_stay = 0; // incompatible
- g_bloodloss = 0; // incompatible
- start_health = 100;
- start_armorvalue = 0;
- WEPSET_COPY_AW(start_weapons, WEP_MINSTANEX);
- g_minstagib_invis_alpha = cvar("g_minstagib_invis_alpha");
- start_items |= IT_UNLIMITED_SUPERWEAPONS;
-
- if (g_minstagib_invis_alpha <= 0)
- g_minstagib_invis_alpha = -1;
- }
else
{
for (i = WEP_FIRST; i <= WEP_LAST; ++i)
if(cvar("g_nexball"))
start_items |= IT_UNLIMITED_SUPERWEAPONS; // FIXME BAD BAD BAD BAD HACK, NEXBALL SHOULDN'T ABUSE PORTO'S WEAPON SLOT
- if(g_minstagib)
- {
- start_ammo_cells = cvar("g_minstagib_ammo_start");
- start_ammo_fuel = cvar("g_start_ammo_fuel");
- }
- else if(start_items & IT_UNLIMITED_WEAPON_AMMO)
+ if(start_items & IT_UNLIMITED_WEAPON_AMMO)
{
start_ammo_rockets = 999;
start_ammo_shells = 999;
MUTATOR_ADD(mutator_dodging);
if(cvar("g_spawn_near_teammate"))
MUTATOR_ADD(mutator_spawn_near_teammate);
+ if(cvar("g_minstagib"))
+ MUTATOR_ADD(mutator_minstagib);
+
if(!g_minstagib)
{
if(cvar("g_invincible_projectiles"))
if(cvar("g_rocket_flying"))
MUTATOR_ADD(mutator_rocketflying);
if(cvar("g_vampire"))
- MUTATOR_ADD(mutator_vampire);
+ MUTATOR_ADD(mutator_vampire);
+ if(cvar("g_superspectate"))
+ MUTATOR_ADD(mutator_superspec);
}
// is this a mutator? is this a mode?
g_bloodloss = cvar("g_bloodloss");
sv_maxidle = cvar("sv_maxidle");
sv_maxidle_spectatorsareidle = cvar("sv_maxidle_spectatorsareidle");
- g_ctf_reverse = cvar("g_ctf_reverse");
sv_autotaunt = cvar("sv_autotaunt");
sv_taunt = cvar("sv_taunt");
precache_sound ("player/lava.wav");
precache_sound ("player/slime.wav");
- if (g_jetpack)
- precache_sound ("misc/jetpack_fly.wav");
-
precache_model ("models/sprites/0.spr32");
precache_model ("models/sprites/1.spr32");
precache_model ("models/sprites/2.spr32");
self = e_old;
}
//dprint("Delayed initialization: ", self.classname, "\n");
- if(func != func_null)
+ if(func)
func();
else
{
.float uncustomizeentityforclient_set;
.void(void) uncustomizeentityforclient;
-void(void) SUB_Nullpointer = #0;
void UncustomizeEntitiesRun()
{
entity oldself;
{
e.customizeentityforclient = customizer;
e.uncustomizeentityforclient = uncustomizer;
- e.uncustomizeentityforclient_set = (uncustomizer != SUB_Nullpointer);
+ e.uncustomizeentityforclient_set = !!uncustomizer;
}
.float nottargeted;
{
if (visual)
{
- vecs_y = 0;
- vecs_z -= 2;
+ if (autocvar_g_shootfromclient) { vecs = shotorg_adjustfromclient(vecs, y_is_right, (autocvar_g_shootfromclient >= 2), algn); }
+ else { vecs_y = 0; vecs_z -= 2; }
}
else
{
return gettaginfo(gettaginfo_relative_ent, tag);
}
-void SoundEntity_StartSound(entity pl, float chan, string samp, float vol, float attn)
-{
- float p;
- p = pow(2, chan);
- if (pl.soundentity.cnt & p)
- return;
- soundtoat(MSG_ALL, pl.soundentity, gettaginfo(pl.soundentity, 0), chan, samp, vol, attn);
- pl.soundentity.cnt |= p;
-}
-
-void SoundEntity_StopSound(entity pl, float chan)
-{
- float p;
- p = pow(2, chan);
- if (pl.soundentity.cnt & p)
- {
- stopsoundto(MSG_ALL, pl.soundentity, chan);
- pl.soundentity.cnt &~= p;
- }
-}
-
-void SoundEntity_Attach(entity pl)
-{
- pl.soundentity = spawn();
- pl.soundentity.classname = "soundentity";
- pl.soundentity.owner = pl;
- setattachment(pl.soundentity, pl, "");
- setmodel(pl.soundentity, "null");
-}
-
-void SoundEntity_Detach(entity pl)
-{
- float i;
- for (i = 0; i <= 7; ++i)
- SoundEntity_StopSound(pl, i);
-}
-
.float scale2;
float modeleffect_SendEntity(entity to, float sf)
{
if(e.iscreature)
return TRUE;
+ if(e.pushable)
+ return TRUE;
switch(e.classname)
{
case "body":