- ln -s $PWD data/xonotic-data.pk3dir
+test_compilation_units:
+ stage: test
+ script:
+ - ./qcsrc/tools/compilationunits.sh
+
test_sv_unit:
stage: test
script:
+++ /dev/null
-Credits go to Dresk for putting this CSQC scratch source together.
-
-and Urre :o
#include <common/mutators/mutator/waypoints/all.qh>
#include <common/stats.qh>
#include <lib/csqcmodel/cl_player.qh>
-// TODO: remove
-#include <server/mutators/mutator/gamemode_ctf.qc>
+#include <server/mutators/mutator/gamemode_ctf.qh> // TODO: remove
/*
it.solid_prev = it.solid;
it.solid = SOLID_BBOX;
});
- vector forward; vector right; vector up;
+ vector forward = '0 0 0'; vector right = '0 0 0'; vector up = '0 0 0';
MAKEVECTORS(makevectors, it.v_angle, forward, right, up);
vector pos = it.origin + it.view_ofs;
traceline(pos, pos + forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, it);
+#include "gibs.qh"
+
#ifdef IMPLEMENTATION
REGISTER_NET_TEMP(net_gibsplash)
--- /dev/null
+#pragma once
+
+#ifdef SVQC
+void Violence_GibSplash_At(vector org, vector dir, float type, float amount, entity gibowner, entity attacker);
+void Violence_GibSplash(entity source, float type, float amount, entity attacker);
+#endif
* @param gs the global sound def
* @param r a random number in 0..1
*/
- void globalsound(int channel, entity from, entity gs, float r, int chan, float vol, float atten)
+ void globalsound(int channel, entity from, entity gs, float r, int chan, float _vol, float _atten)
{
assert(IS_PLAYER(from), eprint(from));
if (channel == MSG_ONE && !IS_REAL_CLIENT(msg_entity)) return;
string sample = GlobalSound_sample(gs.m_globalsoundstr, r);
switch (channel) {
case MSG_ONE:
- soundto(channel, from, chan, sample, vol, atten);
+ soundto(channel, from, chan, sample, _vol, _atten);
break;
case MSG_ALL:
- _sound(from, chan, sample, vol, atten);
+ _sound(from, chan, sample, _vol, _atten);
break;
}
return;
WriteByte(channel, r * 255);
WriteByte(channel, etof(from));
WriteByte(channel, chan);
- WriteByte(channel, floor(vol * 255));
- WriteByte(channel, floor(atten * 64));
+ WriteByte(channel, floor(_vol * 255));
+ WriteByte(channel, floor(_atten * 64));
entcs_force_origin(from);
vector o = from.origin + 0.5 * (from.mins + from.maxs);
WriteCoord(channel, o.x);
* @param ps the player sound def
* @param r a random number in 0..1
*/
- void playersound(int channel, entity from, entity ps, float r, int chan, float vol, float atten)
+ void playersound(int channel, entity from, entity ps, float r, int chan, float _vol, float _atten)
{
assert(IS_PLAYER(from), eprint(from));
if (channel == MSG_ONE && !IS_REAL_CLIENT(msg_entity)) return;
string sample = GlobalSound_sample(s, r);
switch (channel) {
case MSG_ONE:
- soundto(channel, from, chan, sample, vol, atten);
+ soundto(channel, from, chan, sample, _vol, _atten);
break;
case MSG_ALL:
- _sound(from, chan, sample, vol, atten);
+ _sound(from, chan, sample, _vol, _atten);
break;
}
return;
WriteByte(channel, r * 255);
WriteByte(channel, etof(from));
WriteByte(channel, chan);
- WriteByte(channel, floor(vol * 255));
- WriteByte(channel, floor(atten * 64));
+ WriteByte(channel, floor(_vol * 255));
+ WriteByte(channel, floor(_atten * 64));
entcs_force_origin(from);
vector o = from.origin + 0.5 * (from.mins + from.maxs);
WriteCoord(channel, o.x);
return NULL;
}
- string allvoicesamples;
- STATIC_INIT(allvoicesamples)
- {
- FOREACH(PlayerSounds, it.instanceOfVoiceMessage, allvoicesamples = strcat(allvoicesamples, " ", it.m_playersoundstr));
- allvoicesamples = strzone(substring(allvoicesamples, 1, -1));
- }
-
.string _GetPlayerSoundSampleField(string type, bool voice)
{
GetPlayerSoundSampleField_notFound = false;
float LoadPlayerSounds(entity this, string f, bool strict);
void UpdatePlayerSounds(entity this);
//#endif
+entity GetVoiceMessage(string type);
#ifdef SVQC
#endif
+string allvoicesamples;
+STATIC_INIT(allvoicesamples)
+{
+ FOREACH(PlayerSounds, it.instanceOfVoiceMessage, allvoicesamples = strcat(allvoicesamples, " ", it.m_playersoundstr));
+ allvoicesamples = strzone(substring(allvoicesamples, 1, -1));
+}
+
#endif
+#include "lightningarc.qh"
+
#ifdef IMPLEMENTATION
REGISTER_NET_TEMP(TE_CSQC_ARC)
--- /dev/null
+#pragma once
+
+#ifdef SVQC
+void te_csqc_lightningarc(vector from, vector to);
+#endif
+#include "modeleffects.qh"
+
#ifdef IMPLEMENTATION
REGISTER_NET_LINKED(ENT_CLIENT_MODELEFFECT)
--- /dev/null
+#pragma once
+
+#ifdef SVQC
+void modeleffect_spawn(string m, float s, float f, vector o, vector v, vector ang, vector angv, float s0, float s2, float a, float t1, float t2);
+#endif
#ifndef MENUQC
#include "../animdecide.qh"
+#include "../anim.qh"
vector animfixfps(entity e, vector a, vector b);
#endif
+#pragma once
+
#include <common/items/all.qh>
#include <common/items/item/ammo.qh>
#include <common/items/item/powerup.qh>
#include "bot.qh"
+#include <common/physics/player.qh>
+#include <common/state.qh>
+
#include "../weapons/weaponsystem.qh"
#include "../mutators/all.qh"
#include "../weapons/accuracy.qh"
+#include <common/physics/player.qh>
#include <common/constants.qh>
#include <common/mapinfo.qh>
#include <common/teams.qh>
#include "../waypoints.qh"
#include <common/constants.qh>
+#include <common/physics/player.qh>
+#include <common/state.qh>
#include <common/items/all.qh>
#include <common/triggers/trigger/jumppads.qh>
#include "scripting.qh"
+#include <common/state.qh>
+#include <common/physics/player.qh>
+
#include "bot.qh"
.int state;
#include "bot.qh"
#include "navigation.qh"
+#include <common/state.qh>
+
#include "../antilag.qh"
#include <common/constants.qh>
#include "../common/ent_cs.qh"
#include <common/state.qh>
+#include <common/effects/qc/globalsound.qh>
+
#include "../common/triggers/teleporters.qh"
#include "../common/vehicles/all.qh"
#include "weapons/tracing.qh"
#include "weapons/weaponsystem.qh"
+#include <common/state.qh>
+
#include "../common/minigames/sv_minigames.qh"
#include "../common/weapons/all.qh"
#include "teamplay.qh"
#include "weapons/throwing.qh"
#include "command/common.qh"
+#include "../common/state.qh"
#include "../common/anim.qh"
#include "../common/animdecide.qh"
#include "../common/csqcmodel_settings.qh"
#include "../common/minigames/sv_minigames.qh"
+#include "../common/physics/player.qh"
+#include "../common/effects/qc/all.qh"
#include "../common/mutators/mutator/waypoints/waypointsprites.qh"
#include "../common/triggers/include.qh"
#include "cmd.qh"
#include <common/command/command.qh>
-#include "cmd.qh"
#include "common.qh"
#include "vote.qh"
#include <common/constants.qh>
#include <common/deathtypes/all.qh>
+#include <common/effects/all.qh>
#include <common/mapinfo.qh>
#include <common/notifications/all.qh>
#include <common/physics/player.qh>
#include "mutators/all.qh"
#include "scores.qh"
#include "spawnpoints.qh"
+#include "../common/state.qh"
+#include "../common/physics/player.qh"
#include "../common/t_items.qh"
#include "../common/vehicles/all.qh"
#include "../common/items/all.qc"
#include "cl_player.qh"
#include "command/common.qh"
#include "round_handler.qh"
+#include "../common/state.qh"
+#include "../common/physics/player.qh"
#include "../common/vehicles/all.qh"
#include "../common/constants.qh"
#include "../common/util.qh"
#include "antilag.qh"
#include "command/common.qh"
+#include "../common/state.qh"
#include "../lib/warpzone/common.qh"
#include "../common/triggers/subs.qh"
#include "../common/util.qh"
#include "../common/items/all.qh"
#include "../common/weapons/all.qh"
+#include "../common/state.qh"
const float LATENCY_THINKRATE = 10;
.float latency_sum;
float checkrules_suddendeathend;
float checkrules_overtimesadded; //how many overtimes have been already added
-const float WINNING_NO = 0; // no winner, but time limits may terminate the game
-const float WINNING_YES = 1; // winner found
-const float WINNING_NEVER = 2; // no winner, enter overtime if time limit is reached
-const float WINNING_STARTSUDDENDEATHOVERTIME = 3; // no winner, enter suddendeath overtime NOW
+const int WINNING_NO = 0; // no winner, but time limits may terminate the game
+const int WINNING_YES = 1; // winner found
+const int WINNING_NEVER = 2; // no winner, enter overtime if time limit is reached
+const int WINNING_STARTSUDDENDEATHOVERTIME = 3; // no winner, enter suddendeath overtime NOW
+float WinningCondition_Scores(float limit, float leadlimit);
+void SetWinners(.float field, float value);
void CheckRules_Player();
void IntermissionThink();
void GotoNextMap(float reinit);
#include "../common/vehicles/sv_vehicles.qh"
#include "../common/vehicles/vehicle.qh"
#include "../common/items/all.qc"
+#include "../common/state.qh"
+#include "../common/effects/qc/globalsound.qh"
#include "../lib/csqcmodel/sv_model.qh"
#include "../lib/warpzone/anglestransform.qh"
#include "../lib/warpzone/server.qh"
return 0;
}
-float isPushable(entity e)
+.bool pushable;
+bool isPushable(entity e)
{
if(e.pushable)
return true;
#include <server/cl_impulse.qh>
#include <server/cheats.qh>
#include <server/g_damage.qh>
+#include <server/g_world.qh>
#include <server/round_handler.qh>
#include <server/scores.qh>
#include <server/scores_rules.qh>
#include <server/weapons/tracing.qh>
#include <server/weapons/weaponsystem.qh>
+#include <common/physics/player.qh>
+#include <common/effects/qc/all.qh>
#include <common/deathtypes/all.qh>
#include <common/notifications/all.qh>
#include <common/triggers/teleporters.qh>
#define GAMEMODE_ASSAULT_H
void assault_ScoreRules();
+void ActivateTeamplay();
REGISTER_MUTATOR(as, false)
{
#pragma once
+
+#include "../gamemode.qh"
void CA_RoundStart();
bool ca_isEliminated(entity e);
+void SetLimits(int fraglimit_override, int leadlimit_override, float timelimit_override, float qualifying_override);
+
REGISTER_MUTATOR(ca, false)
{
MUTATOR_ONADD
return -1; // no player left
}
+void nades_Clear(entity player);
+
#define CA_ALIVE_TEAMS() ((redalive > 0) + (bluealive > 0) + (yellowalive > 0) + (pinkalive > 0))
#define CA_ALIVE_TEAMS_OK() (CA_ALIVE_TEAMS() == ca_teams)
float CA_CheckWinner()
#pragma once
+
+#include "../gamemode.qh"
// Event Handlers
// ==============
+void nades_GiveBonus(entity player, float score);
+
void ctf_Handle_Capture(entity flag, entity toucher, int capturetype)
{
entity enemy_flag = ((capturetype == CAPTURE_NORMAL) ? toucher.flagcarried : toucher);
ctf_CaptureShield_Spawn(self);
}
+.bool pushable;
+
void ctf_FlagSetup(int teamnumber, entity flag) // called when spawning a flag entity on the map as a spawnfunc
{SELFPARAM();
// declarations
#pragma once
#ifdef SVQC
+
+#include "../gamemode.qh"
// used in cheats.qc
void ctf_RespawnFlag(entity flag);
GameLogEcho(strcat(":cts:", mode, ":", ((actor != world) ? (strcat(":", ftos(actor.playerid))) : "")));
}
+void KillIndicator_Think();
void CTS_ClientKill(entity e) // silent version of ClientKill, used when player finishes a CTS run. Useful to prevent cheating by running back to the start line and starting out with more speed
{
e.killindicator = spawn();
return false;
}
+void ClientKill_Now();
MUTATOR_HOOKFUNCTION(cts, ClientKill)
{
ret_float = 0;
#pragma once
+
+#include "../gamemode.qh"
#pragma once
+
+#include "../gamemode.qh"
#pragma once
+
+#include "../gamemode.qh"
#pragma once
+
+#include "../gamemode.qh"
#pragma once
+
+#include "../gamemode.qh"
#pragma once
+
+#include "../gamemode.qh"
#pragma once
+
+#include "../gamemode.qh"
#ifdef IMPLEMENTATION
+#include <common/mutators/mutator/instagib/items.qc>
#include <server/campaign.qh>
#include <server/command/cmd.qh>
return bound(1, lms_lowest_lives, fl);
}
+void ClearWinners();
+
// LMS winning condition: game terminates if and only if there's at most one
// one player who's living lives. Top two scores being equal cancels the time
// limit.
#pragma once
+
+#include "../gamemode.qh"
#include "gamemode_race.qh"
+
#ifndef GAMEMODE_RACE_H
#define GAMEMODE_RACE_H
return 0;
}
-float race_teams;
-
-// scores
-const float ST_RACE_LAPS = 1;
-const float SP_RACE_LAPS = 4;
-const float SP_RACE_TIME = 5;
-const float SP_RACE_FASTEST = 6;
#endif
#ifdef IMPLEMENTATION
#pragma once
+
+#include "../gamemode.qh"
#pragma once
+
+#include "../gamemode.qh"
+++ /dev/null
-
-/* file generated by qcc, do not modify */
-
-typedef struct
-{ int pad[28];
- int self;
- int other;
- int world;
- float time;
- float frametime;
- float force_retouch;
- string_t mapname;
- float deathmatch;
- float coop;
- float teamplay;
- float serverflags;
- float total_secrets;
- float total_monsters;
- float found_secrets;
- float killed_monsters;
- float parm1;
- float parm2;
- float parm3;
- float parm4;
- float parm5;
- float parm6;
- float parm7;
- float parm8;
- float parm9;
- float parm10;
- float parm11;
- float parm12;
- float parm13;
- float parm14;
- float parm15;
- float parm16;
- vec3_t v_forward;
- vec3_t v_up;
- vec3_t v_right;
- float trace_allsolid;
- float trace_startsolid;
- float trace_fraction;
- vec3_t trace_endpos;
- vec3_t trace_plane_normal;
- float trace_plane_dist;
- int trace_ent;
- float trace_inopen;
- float trace_inwater;
- int msg_entity;
- func_t main;
- func_t StartFrame;
- func_t PlayerPreThink;
- func_t PlayerPostThink;
- func_t ClientKill;
- func_t ClientConnect;
- func_t PutClientInServer;
- func_t ClientDisconnect;
- func_t SetNewParms;
- func_t SetChangeParms;
-} globalvars_t;
-
-typedef struct
-{
- float modelindex;
- vec3_t absmin;
- vec3_t absmax;
- float ltime;
- float movetype;
- float solid;
- vec3_t origin;
- vec3_t oldorigin;
- vec3_t velocity;
- vec3_t angles;
- vec3_t avelocity;
- vec3_t punchangle;
- string_t classname;
- string_t model;
- float frame;
- float skin;
- float effects;
- vec3_t mins;
- vec3_t maxs;
- vec3_t size;
- func_t touch;
- func_t use;
- func_t think;
- func_t blocked;
- float nextthink;
- int groundentity;
- float health;
- float frags;
- float weapon;
- string_t weaponmodel;
- float weaponframe;
- float currentammo;
- float ammo_shells;
- float ammo_nails;
- float ammo_rockets;
- float ammo_cells;
- float items;
- float takedamage;
- int chain;
- float deadflag;
- vec3_t view_ofs;
- float button0;
- float button1;
- float button2;
- float impulse;
- float fixangle;
- vec3_t v_angle;
- float idealpitch;
- string_t netname;
- int enemy;
- float flags;
- float colormap;
- float team;
- float max_health;
- float teleport_time;
- float armortype;
- float armorvalue;
- float waterlevel;
- float watertype;
- float ideal_yaw;
- float yaw_speed;
- int aiment;
- int goalentity;
- float spawnflags;
- string_t target;
- string_t targetname;
- float dmg_take;
- float dmg_save;
- int dmg_inflictor;
- int owner;
- vec3_t movedir;
- string_t message;
- float sounds;
- string_t noise;
- string_t noise1;
- string_t noise2;
- string_t noise3;
-} entvars_t;
-
-#define PROGHEADER_CRC 5927
#pragma once
+float race_teams;
+
+// scores
+const float ST_RACE_LAPS = 1;
+const float SP_RACE_LAPS = 4;
+const float SP_RACE_TIME = 5;
+const float SP_RACE_FASTEST = 6;
+
bool g_race_qualifying;
float speedaward_lastsent;
#include "../antilag.qh"
#include "../g_subs.qh"
#include <common/weapons/all.qh>
+#include <common/state.qh>
vector W_HitPlotUnnormalizedUntransform(vector screenforward, vector screenright, vector screenup, vector v)
{
#include <common/util.qh>
#include <common/items/item.qh>
#include <common/weapons/all.qh>
+#include <common/state.qh>
#include <common/mutators/mutator/waypoints/waypointsprites.qh>
// switch between weapons
#include <common/triggers/subs.qh>
#include <common/util.qh>
#include <common/weapons/all.qh>
+#include <common/state.qh>
void thrown_wep_think()
{SELFPARAM();
#include <common/util.qh>
#include <common/weapons/all.qh>
+#include <common/state.qh>
#include <lib/warpzone/common.qh>
#include <common/notifications/all.qh>
#include <common/util.qh>
#include <common/weapons/all.qh>
+#include <common/state.qh>
#include <lib/csqcmodel/sv_model.qh>
.int state;
WORKDIR=../.tmp
CPP="cc -xc -E"
-QCC=../../../../gmqcc/gmqcc
+: ${QCC:=$PWD/../../../../gmqcc/gmqcc}
declare -a QCCDEFS=(
-DNDEBUG=1
-DWATERMARK="\"$(git describe --tags --dirty='*')\""
+ -DDEBUGPATHING=0
)
QCCDEFS="${QCCDEFS[@]}"