#include "world.qh"
#include <server/gamelog.qh>
#include "ipban.qh"
+#include <server/intermission.qh>
#include <server/items/items.qh>
#include <server/mutators/_mod.qh>
#include <server/spawnpoints.qh>
WarpZone_traceline_antilag(pl, CS(pl).cursor_trace_start, CS(pl).cursor_trace_start + normalize(CS(pl).cursor_trace_endpos - CS(pl).cursor_trace_start) * max_shot_distance, MOVE_NORMAL, pl, ANTILAG_LATENCY(pl));
}
-void dedicated_print(string input)
-{
- if (server_is_dedicated) print(input);
-}
-
entity findnearest(vector point, bool checkitems, vector axismod)
{
vector dist;
warmup_start_weapons_default = '0 0 0';
warmup_start_weapons_defaultmask = '0 0 0';
FOREACH(Weapons, it != WEP_Null, {
- int w = want_weapon(it, g_warmup_allguns);
+ int w = want_weapon(it, autocvar_g_warmup_allguns);
WepSet s = it.m_wepset;
if(w & 1)
warmup_start_weapons |= s;
});
}
- if (g_jetpack)
+ if (autocvar_g_jetpack)
start_items |= ITEM_Jetpack.m_itemid;
MUTATOR_CALLHOOK(SetStartItems);
}
}
-
-void make_safe_for_remove(entity e)
-{
- if (e.initialize_entity)
- {
- entity ent, prev = NULL;
- for (ent = initialize_entity_first; ent; )
- {
- if ((ent == e) || ((ent.classname == "initialize_entity") && (ent.enemy == e)))
- {
- //print("make_safe_for_remove: getting rid of initializer ", etos(ent), "\n");
- // skip it in linked list
- if (prev)
- {
- prev.initialize_entity_next = ent.initialize_entity_next;
- ent = prev.initialize_entity_next;
- }
- else
- {
- initialize_entity_first = ent.initialize_entity_next;
- ent = initialize_entity_first;
- }
- }
- else
- {
- prev = ent;
- ent = ent.initialize_entity_next;
- }
- }
- }
-}
-
-.float remove_except_protected_forbidden;
-void remove_except_protected(entity e)
-{
- if(e.remove_except_protected_forbidden)
- error("not allowed to remove this at this point");
- builtin_remove(e);
-}
-
-void remove_unsafely(entity e)
-{
- if(e.classname == "spike")
- error("Removing spikes is forbidden (crylink bug), please report");
- builtin_remove(e);
-}
-
-void remove_safely(entity e)
-{
- make_safe_for_remove(e);
- builtin_remove(e);
-}
-
void InitializeEntity(entity e, void(entity this) func, int order)
{
entity prev, cur;
delete_fn = remove_unsafely;
}
-.float(entity) isEliminated;
-bool EliminatedPlayers_SendEntity(entity this, entity to, float sendflags)
-{
- Stream out = MSG_ENTITY;
- WriteHeader(out, ENT_CLIENT_ELIMINATEDPLAYERS);
- serialize(byte, out, sendflags);
- if (sendflags & 1) {
- for (int i = 1; i <= maxclients; i += 8) {
- int f = 0;
- entity e = edict_num(i);
- for (int b = 0; b < 8; ++b, e = nextent(e)) {
- if (eliminatedPlayers.isEliminated(e)) {
- f |= BIT(b);
- }
- }
- serialize(byte, out, f);
- }
- }
- return true;
-}
-
-void EliminatedPlayers_Init(float(entity) isEliminated_func)
-{
- if(eliminatedPlayers)
- {
- backtrace("Can't spawn eliminatedPlayers again!");
- return;
- }
- Net_LinkEntity(eliminatedPlayers = spawn(), false, 0, EliminatedPlayers_SendEntity);
- eliminatedPlayers.isEliminated = isEliminated_func;
-}
-
-
-
-
void adaptor_think2use_hittype_splash(entity this) // for timed projectile detonation
{
if(!(IS_ONGROUND(this))) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING
return 0;
}
-.bool pushable;
-bool isPushable(entity e)
-{
- if(e.pushable)
- return true;
- if(IS_VEHICLE(e))
- return false;
- if(e.iscreature)
- return true;
- if (Item_IsLoot(e))
- {
- return true;
- }
- switch(e.classname)
- {
- case "body":
- return true;
- case "bullet": // antilagged bullets can't hit this either
- return false;
- }
- if (e.projectiledeathtype)
- return true;
- return false;
-}
-
string GetField_fullspawndata(entity e, string f, ...)
/* Retrieves the value of a map entity field from fullspawndata
* This bypasses field value changes made by the engine,