}
}
-vector PL_VIEW_OFS;
-vector PL_MIN;
-vector PL_MAX;
-vector PL_HEAD;
-vector PL_CROUCH_VIEW_OFS;
-vector PL_CROUCH_MIN;
-vector PL_CROUCH_MAX;
-
float spawnpoint_nag;
void relocate_spawnpoint()
{
- PL_VIEW_OFS = stov(autocvar_sv_player_viewoffset);
- PL_MIN = stov(autocvar_sv_player_mins);
- PL_MAX = stov(autocvar_sv_player_maxs);
- PL_HEAD = stov(autocvar_sv_player_headsize);
- PL_CROUCH_VIEW_OFS = stov(autocvar_sv_player_crouch_viewoffset);
- PL_CROUCH_MIN = stov(autocvar_sv_player_crouch_mins);
- PL_CROUCH_MAX = stov(autocvar_sv_player_crouch_maxs);
-
// nudge off the floor
setorigin(self, self.origin + '0 0 1');
MUTATOR_CALLHOOK(GetCvars);
GetCvars_handleFloat(s, f, autoswitch, "cl_autoswitch");
GetCvars_handleFloat(s, f, cvar_cl_autoscreenshot, "cl_autoscreenshot");
- GetCvars_handleFloat(s, f, cvar_cl_playerdetailreduction, "cl_playerdetailreduction");
GetCvars_handleString(s, f, cvar_g_xonoticversion, "g_xonoticversion");
GetCvars_handleFloat(s, f, cvar_cl_handicap, "cl_handicap");
GetCvars_handleFloat(s, f, cvar_cl_clippedspectating, "cl_clippedspectating");
start_weapons = WEPBIT_MINSTANEX;
weapon_action(WEP_MINSTANEX, WR_PRECACHE);
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;
if (g_jetpack)
start_items |= IT_JETPACK;
- if (g_weapon_stay == 2)
- {
- if (!start_ammo_shells) start_ammo_shells = g_pickup_shells;
- if (!start_ammo_nails) start_ammo_nails = g_pickup_nails;
- if (!start_ammo_cells) start_ammo_cells = g_pickup_cells;
- if (!start_ammo_rockets) start_ammo_rockets = g_pickup_rockets;
- if (!start_ammo_fuel) start_ammo_fuel = g_pickup_fuel;
- if (!warmup_start_ammo_shells) warmup_start_ammo_shells = g_pickup_shells;
- if (!warmup_start_ammo_nails) warmup_start_ammo_nails = g_pickup_nails;
- if (!warmup_start_ammo_cells) warmup_start_ammo_cells = g_pickup_cells;
- if (!warmup_start_ammo_rockets) warmup_start_ammo_rockets = g_pickup_rockets;
- if (!warmup_start_ammo_fuel) warmup_start_ammo_fuel = g_pickup_fuel;
- }
-
MUTATOR_CALLHOOK(SetStartItems);
for (i = WEP_FIRST; i <= WEP_LAST; ++i)
MUTATOR_ADD(mutator_rocketflying);
if(cvar("g_vampire"))
MUTATOR_ADD(mutator_vampire);
+ if(cvar("g_spawn_near_teammate"))
+ MUTATOR_ADD(mutator_spawn_near_teammate);
+
+ // is this a mutator? is this a mode?
if(cvar("g_sandbox"))
MUTATOR_ADD(sandbox);
#ifdef ALLOW_FORCEMODELS
sv_clforceplayermodels = cvar("sv_clforceplayermodels");
#endif
- sv_loddistance1 = cvar("sv_loddistance1");
- sv_loddistance2 = cvar("sv_loddistance2");
-
- if(sv_loddistance2 <= sv_loddistance1)
- sv_loddistance2 = 1073741824; // enough to turn off LOD 2 reliably
sv_clones = cvar("sv_clones");
sv_gentle = cvar("sv_gentle");
inWarmupStage = 0; // these modes cannot work together, sorry
g_pickup_respawntime_weapon = cvar("g_pickup_respawntime_weapon");
+ g_pickup_respawntime_superweapon = cvar("g_pickup_respawntime_superweapon");
g_pickup_respawntime_ammo = cvar("g_pickup_respawntime_ammo");
g_pickup_respawntime_short = cvar("g_pickup_respawntime_short");
g_pickup_respawntime_medium = cvar("g_pickup_respawntime_medium");
g_pickup_respawntime_long = cvar("g_pickup_respawntime_long");
g_pickup_respawntime_powerup = cvar("g_pickup_respawntime_powerup");
g_pickup_respawntimejitter_weapon = cvar("g_pickup_respawntimejitter_weapon");
+ g_pickup_respawntimejitter_superweapon = cvar("g_pickup_respawntimejitter_superweapon");
g_pickup_respawntimejitter_ammo = cvar("g_pickup_respawntimejitter_ammo");
g_pickup_respawntimejitter_short = cvar("g_pickup_respawntimejitter_short");
g_pickup_respawntimejitter_medium = cvar("g_pickup_respawntimejitter_medium");
}
#ifdef COMPAT_XON010_CHANNELS
-void(entity e, float chan, string samp, float vol, float atten) sound_builtin = #8;
+void(entity e, float chan, string samp, float vol, float atten) builtin_sound = #8;
void sound(entity e, float chan, string samp, float vol, float atten)
{
if (!sound_allowed(MSG_BROADCAST, e))
return;
- sound_builtin(e, chan, samp, vol, atten);
+ builtin_sound(e, chan, samp, vol, atten);
}
#else
#undef sound
if(substring(m, -9,5) == "_lod2")
return;
precache_model(m);
- if(sv_loddistance1)
- {
- f = strcat(substring(m, 0, -5), "_lod1", substring(m, -4, -1));
- if(fexists(f))
- precache_model(f);
- f = strcat(substring(m, 0, -5), "_lod2", substring(m, -4, -1));
- if(fexists(f))
- precache_model(f);
- }
+ f = strcat(substring(m, 0, -5), "_lod1", substring(m, -4, -1));
+ if(fexists(f))
+ precache_model(f);
+ f = strcat(substring(m, 0, -5), "_lod2", substring(m, -4, -1));
+ if(fexists(f))
+ precache_model(f);
globhandle = search_begin(strcat(m, "_*.sounds"), TRUE, FALSE);
if (globhandle < 0)
void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration, float countdown_num)
{
- if (clienttype(e) == CLIENTTYPE_REAL)
+ if ((clienttype(e) == CLIENTTYPE_REAL) && (e.flags & FL_CLIENT))
{
msg_entity = e;
WRITESPECTATABLE_MSG_ONE({
void objerror(string s)
{
make_safe_for_remove(self);
- objerror_builtin(s);
+ builtin_objerror(s);
}
.float remove_except_protected_forbidden;
{
if(e.remove_except_protected_forbidden)
error("not allowed to remove this at this point");
- remove_builtin(e);
+ builtin_remove(e);
}
void remove_unsafely(entity e)
{
if(e.classname == "spike")
error("Removing spikes is forbidden (crylink bug), please report");
- remove_builtin(e);
+ builtin_remove(e);
}
void remove_safely(entity e)
{
make_safe_for_remove(e);
- remove_builtin(e);
+ builtin_remove(e);
}
void InitializeEntity(entity e, void(void) func, float order)
{
entity e_old;
e_old = self.enemy;
- remove_builtin(self);
+ builtin_remove(self);
self = e_old;
}
//dprint("Delayed initialization: ", self.classname, "\n");
// deferred dropping
void DropToFloor_Handler()
{
- droptofloor_builtin();
+ builtin_droptofloor();
self.dropped_origin = self.origin;
}
}
}
-void print_to(entity e, string s)
-{
- if (e)
- sprint(e, strcat(s, "\n"));
- else
- print(s, "\n");
-}
-
string uid2name(string myuid) {
string s;
s = db_get(ServerProgsDB, strcat("/uid2name/", myuid));
else
return strcat(ftos(pos), "th");
}
-string getrecords(float page) // 50 records per page
-{
- float rec;
- string h;
- float r;
- float i;
- string s;
-
- rec = 0;
-
- s = "";
-
- if (g_ctf)
- {
- for (i = page * 200; i < MapInfo_count && i < page * 200 + 200; ++i)
- {
- if (MapInfo_Get_ByID(i))
- {
- r = stof(db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, "/captimerecord/time")));
- if (r == 0)
- continue;
- // TODO: uid2name
- h = db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, "/captimerecord/netname"));
- s = strcat(s, strpad(32, MapInfo_Map_bspname), " ", strpad(-6, ftos_decimals(r, 2)), " ", h, "\n");
- ++rec;
- }
- }
- }
-
- if (g_race)
- {
- for (i = page * 200; i < MapInfo_count && i < page * 200 + 200; ++i)
- {
- if (MapInfo_Get_ByID(i))
- {
- r = race_readTime(MapInfo_Map_bspname, 1);
- if (r == 0)
- continue;
- h = race_readName(MapInfo_Map_bspname, 1);
- s = strcat(s, strpad(32, MapInfo_Map_bspname), " ", strpad(-8, TIME_ENCODED_TOSTRING(r)), " ", h, "\n");
- ++rec;
- }
- }
- }
-
- if (g_cts)
- {
- for (i = page * 200; i < MapInfo_count && i < page * 200 + 200; ++i)
- {
- if (MapInfo_Get_ByID(i))
- {
- r = race_readTime(MapInfo_Map_bspname, 1);
- if (r == 0)
- continue;
- h = race_readName(MapInfo_Map_bspname, 1);
- s = strcat(s, strpad(32, MapInfo_Map_bspname), " ", strpad(-8, TIME_ENCODED_TOSTRING(r)), " ", h, "\n");
- ++rec;
- }
- }
- }
-
- MapInfo_ClearTemps();
-
- if (s == "" && page == 0)
- return "No records are available on this server.\n";
- else
- return s;
-}
-
-string getrankings()
-{
- string n;
- float t;
- float i;
- string s;
- string p;
- string map;
-
- s = "";
-
- map = GetMapname();
-
- for (i = 1; i <= RANKINGS_CNT; ++i)
- {
- t = race_readTime(map, i);
- if (t == 0)
- continue;
- n = race_readName(map, i);
- p = race_placeName(i);
- s = strcat(s, strpad(8, p), " ", strpad(-8, TIME_ENCODED_TOSTRING(t)), " ", n, "\n");
- }
-
- MapInfo_ClearTemps();
-
- if (s == "")
- return strcat("No records are available for the map: ", map, "\n");
- else
- return strcat("Records for ", map, ":\n", s);
-}
-
-#define LADDER_FIRSTPOINT 100
-#define LADDER_CNT 10
- // position X still gives LADDER_FIRSTPOINT/X points
-#define LADDER_SIZE 30
- // ladder shows the top X players
-string top_uids[LADDER_SIZE];
-float top_scores[LADDER_SIZE];
-string getladder()
-{
- float i, j, k, uidcnt;
- string s, temp_s;
-
- s = "";
- temp_s = "";
-
- string rr;
- if(g_cts)
- rr = CTS_RECORD;
- else
- rr = RACE_RECORD;
-
- string myuid;
-
- for (k = 0; k < MapInfo_count; ++k)
- {
- if (MapInfo_Get_ByID(k))
- {
- for (i = 0; i <= LADDER_CNT; ++i) { // i = 0 because it is the speed award
- if(i == 0) // speed award
- {
- if(stof(db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, rr, "speed/speed"))) == 0)
- continue;
-
- myuid = db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, rr, "speed/crypto_idfp"));
- }
- else // normal record, if it exists (else break)
- {
- if(race_readTime(MapInfo_Map_bspname, i) == 0)
- continue;
-
- myuid = race_readUID(MapInfo_Map_bspname, i);
- }
-
- // string s contains:
- // arg 0 = # of speed recs
- // arg 1 = # of 1st place recs
- // arg 2 = # of 2nd place recs
- // ... etc
- // LADDER_CNT+1 = total points
-
- temp_s = db_get(TemporaryDB, strcat("ladder", myuid));
- if (temp_s == "")
- {
- db_put(TemporaryDB, strcat("uid", ftos(uidcnt)), myuid);
- ++uidcnt;
- for (j = 0; j <= LADDER_CNT + 1; ++j)
- {
- if(j != LADDER_CNT + 1)
- temp_s = strcat(temp_s, "0 ");
- else
- temp_s = strcat(temp_s, "0");
- }
- }
-
- tokenize_console(temp_s);
- s = "";
-
- if(i == 0) // speed award
- for (j = 0; j <= LADDER_CNT; ++j) // loop over each arg in the string
- {
- if(j == 0) // speed award
- s = strcat(s, ftos(stof(argv(j)) +1)); // add 1 to speed rec count and write
- else
- s = strcat(s, " ", argv(j)); // just copy over everything else
- }
- else // record
- for (j = 0; j <= LADDER_CNT; ++j) // loop over each arg in the string
- {
- if(j == 0)
- s = strcat(s, argv(j)); // speed award, dont prefix with " "
- else if(j == i) // wanted rec!
- s = strcat(s, " ", ftos(stof(argv(j)) +1)); // update argv(j)
- else
- s = strcat(s, " ", argv(j)); // just copy over everything else
- }
-
- // total points are (by default) calculated like this:
- // speedrec = floor(100 / 10) = 10 points
- // 1st place = floor(100 / 1) = 100 points
- // 2nd place = floor(100 / 2) = 50 points
- // 3rd place = floor(100 / 3) = 33 points
- // 4th place = floor(100 / 4) = 25 points
- // 5th place = floor(100 / 5) = 20 points
- // ... etc
-
- if(i == 0)
- s = strcat(s, " ", ftos(stof(argv(LADDER_CNT+1)) + LADDER_FIRSTPOINT / 10)); // speed award, add LADDER_FIRSTPOINT / 10 points
- else
- s = strcat(s, " ", ftos(stof(argv(LADDER_CNT+1)) + floor(LADDER_FIRSTPOINT / i))); // record, add LADDER_FIRSTPOINT / i points
-
- db_put(TemporaryDB, strcat("ladder", myuid), s);
- }
- }
- }
-
- float thiscnt;
- string thisuid;
- for (i = 0; i <= uidcnt; ++i) // for each known uid
- {
- thisuid = db_get(TemporaryDB, strcat("uid", ftos(i)));
- temp_s = db_get(TemporaryDB, strcat("ladder", thisuid));
- tokenize_console(temp_s);
- thiscnt = stof(argv(LADDER_CNT+1));
-
- if(thiscnt > top_scores[LADDER_SIZE-1])
- for (j = 0; j < LADDER_SIZE; ++j) // for each place in ladder
- {
- if(thiscnt > top_scores[j])
- {
- for (k = LADDER_SIZE-1; k >= j; --k)
- {
- top_uids[k] = top_uids[k-1];
- top_scores[k] = top_scores[k-1];
- }
- top_uids[j] = thisuid;
- top_scores[j] = thiscnt;
- break;
- }
- }
- }
-
- s = "^3-----------------------\n\n";
-
- s = strcat(s, "Pos ^3|");
- s = strcat(s, " ^7Total ^3|");
- for (i = 1; i <= LADDER_CNT; ++i)
- {
- s = strcat(s, " ^7", race_placeName(i), " ^3|");
- }
- s = strcat(s, " ^7Speed awards ^3| ^7Name");
-
- s = strcat(s, "\n^3----+--------");
- for (i = 1; i <= min(9, LADDER_CNT); ++i)
- {
- s = strcat(s, "+-----");
- }
-#if LADDER_CNT > 9
- for (i = 1; i <= LADDER_CNT - 9; ++i)
- {
- s = strcat(s, "+------");
- }
-#endif
-
- s = strcat(s, "+--------------+--------------------\n");
-
- for (i = 0; i < LADDER_SIZE; ++i)
- {
- temp_s = db_get(TemporaryDB, strcat("ladder", top_uids[i]));
- tokenize_console(temp_s);
- if (argv(LADDER_CNT+1) == "") // total is 0, skip
- continue;
- s = strcat(s, strpad(4, race_placeName(i+1)), "^3| ^7"); // pos
- s = strcat(s, strpad(7, argv(LADDER_CNT+1)), "^3| ^7"); // total
- for (j = 1; j <= min(9, LADDER_CNT); ++j)
- {
- s = strcat(s, strpad(4, argv(j)), "^3| ^7"); // 1st, 2nd, 3rd etc cnt
- }
-#if LADDER_CNT > 9
- for (j = 10; j <= LADDER_CNT; ++j)
- {
- s = strcat(s, strpad(4, argv(j)), " ^3| ^7"); // 1st, 2nd, 3rd etc cnt
- }
-#endif
-
- s = strcat(s, strpad(13, argv(0)), "^3| ^7"); // speed award cnt
- s = strcat(s, uid2name(top_uids[i]), "\n"); // name
- }
-
- MapInfo_ClearTemps();
-
- if (s == "")
- return "No ladder on this server!\n";
- else
- return strcat("Top ", ftos(LADDER_SIZE), " ladder rankings:\n", s);
-}
-
float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance)
{
SoundEntity_StopSound(pl, i);
}
-
-float ParseCommandPlayerSlotTarget_firsttoken;
-entity GetCommandPlayerSlotTargetFromTokenizedCommand(float tokens, float idx) // idx = start index
-{
- string s;
- entity e, head;
- float n;
-
- s = string_null;
-
- ParseCommandPlayerSlotTarget_firsttoken = -1;
-
- if (tokens > idx)
- {
- if (substring(argv(idx), 0, 1) == "#")
- {
- s = substring(argv(idx), 1, -1);
- ++idx;
- if (s == "") if (tokens > idx)
- {
- s = argv(idx);
- ++idx;
- }
- ParseCommandPlayerSlotTarget_firsttoken = idx;
- n = stof(s);
- if (s == ftos(n) && n > 0 && n <= maxclients)
- {
- e = edict_num(n);
- if (e.flags & FL_CLIENT)
- return e;
- }
- }
- else
- {
- // it must be a nick name
- s = argv(idx);
- ++idx;
- ParseCommandPlayerSlotTarget_firsttoken = idx;
-
- n = 0;
- FOR_EACH_CLIENT(head)
- if (head.netname == s)
- {
- e = head;
- ++n;
- }
- if (n == 1)
- return e;
-
- s = strdecolorize(s);
- n = 0;
- FOR_EACH_CLIENT(head)
- if (strdecolorize(head.netname) == s)
- {
- e = head;
- ++n;
- }
- if (n == 1)
- return e;
- }
- }
-
- return world;
-}
-
.float scale2;
float modeleffect_SendEntity(entity to, float sf)
#ifdef RELEASE
-#define cvar_string_normal cvar_string_builtin
-#define cvar_normal cvar_builtin
+#define cvar_string_normal builtin_cvar_string
+#define cvar_normal builtin_cvar
#else
string cvar_string_normal(string n)
{
if not(cvar_type(n) & 1)
backtrace(strcat("Attempt to access undefined cvar: ", n));
- return cvar_string_builtin(n);
+ return builtin_cvar_string(n);
}
float cvar_normal(string n)
return stof(cvar_string_normal(n));
}
#endif
-#define cvar_set_normal cvar_set_builtin
+#define cvar_set_normal builtin_cvar_set
void defer_think()
{