float ticrate;
.float damageforcescale;
-#define MIN_DAMAGEEXTRARADIUS 2
-#define MAX_DAMAGEEXTRARADIUS 16
+const float MIN_DAMAGEEXTRARADIUS = 2;
+const float MAX_DAMAGEEXTRARADIUS = 16;
.float damageextraradius;
.void(float thisdmg, float hittype, vector org, vector thisforce) event_damage;
entity trueaim;
entity trueaim_rifle;
-#define SHOTTYPE_HITTEAM 1
-#define SHOTTYPE_HITOBSTRUCTION 2
-#define SHOTTYPE_HITWORLD 3
-#define SHOTTYPE_HITENEMY 4
+const float SHOTTYPE_HITTEAM = 1;
+const float SHOTTYPE_HITOBSTRUCTION = 2;
+const float SHOTTYPE_HITWORLD = 3;
+const float SHOTTYPE_HITENEMY = 4;
void TrueAim_Init()
{
vector freeze_org, freeze_ang;
entity nightvision_noise, nightvision_noise2;
-#define MAX_TIME_DIFF 5
+const float MAX_TIME_DIFF = 5;
float pickup_crosshair_time, pickup_crosshair_size;
float hitindication_crosshair_size;
float use_vortex_chargepool;
}
}
-#define BUTTON_3 4
-#define BUTTON_4 8
+const float BUTTON_3 = 4;
+const float BUTTON_4 = 8;
float cl_notice_run();
float prev_myteam;
void CSQC_UpdateView(float w, float h)
-#define world world
-
// Mask Constants (set .drawmask on entities; use R_AddEntities to add all entities based on mask)
const float MASK_ENGINE = 1;
const float MASK_ENGINEVIEWMODELS = 2;
const float BUTTON_15 = 131072;
const float BUTTON_16 = 262144;
-#define SOLID_NOT 0 // no interaction with other objects
-#define SOLID_TRIGGER 1 // touch on edge, but not blocking
-#define SOLID_BBOX 2 // touch on edge, block
-#define SOLID_SLIDEBOX 3 // touch on edge, but not an onground
-#define SOLID_BSP 4 // bsp clip, touch on edge, block
-#define SOLID_CORPSE 5 // same as SOLID_BBOX, except it behaves as SOLID_NOT against SOLID_SLIDEBOX objects (players/monsters)
+const float SOLID_NOT = 0; // no interaction with other objects
+const float SOLID_TRIGGER = 1; // touch on edge, but not blocking
+const float SOLID_BBOX = 2; // touch on edge, block
+const float SOLID_SLIDEBOX = 3; // touch on edge, but not an onground
+const float SOLID_BSP = 4; // bsp clip, touch on edge, block
+const float SOLID_CORPSE = 5; // same as SOLID_BBOX, except it behaves as SOLID_NOT against SOLID_SLIDEBOX objects (players/monsters)
const float MOVE_NORMAL = 0; // same as FALSE
const float MOVE_NOMONSTERS = 1; // same as TRUE
{
float score;
entity tm = world, pl;
-#define SCOREPANEL_MAX_ENTRIES 6
-#define SCOREPANEL_ASPECTRATIO 2
+ float SCOREPANEL_MAX_ENTRIES = 6;
+ float SCOREPANEL_ASPECTRATIO = 2;
float entries = bound(1, floor(SCOREPANEL_MAX_ENTRIES * mySize_y/mySize_x * SCOREPANEL_ASPECTRATIO), SCOREPANEL_MAX_ENTRIES);
vector fontsize = '1 1 0' * (mySize_y/entries);
// CenterPrint (#16)
//
-#define CENTERPRINT_MAX_MSGS 10
-#define CENTERPRINT_MAX_ENTRIES 50
-#define CENTERPRINT_SPACING 0.7
+const float CENTERPRINT_MAX_MSGS = 10;
+const float CENTERPRINT_MAX_ENTRIES = 50;
+const float CENTERPRINT_SPACING = 0.7;
float cpm_index;
string centerprint_messages[CENTERPRINT_MAX_MSGS];
float centerprint_msgID[CENTERPRINT_MAX_MSGS];
-#define HUD_PANEL_MAX 24
+const float HUD_PANEL_MAX = 24;
entity hud_panel[HUD_PANEL_MAX];
-#define HUD_PANEL_FIRST 0
+const float HUD_PANEL_FIRST = 0;
float HUD_PANEL_NUM;
float HUD_PANEL_LAST;
HUD_Panel_GetBorder() \
} ENDS_WITH_CURLY_BRACE
-#define NOTIFY_MAX_ENTRIES 10
-#define NOTIFY_ICON_MARGIN 0.02
+const float NOTIFY_MAX_ENTRIES = 10;
+const float NOTIFY_ICON_MARGIN = 0.02;
float notify_index;
float notify_count;
// --------------------------------------------------------------------------
// MENU Functionality
-#define DATABUF_PING 0
+const float DATABUF_PING = 0;
#define DATABUF_CAPTURES (1*maxclients)
#define DATABUF_DEATHS (2*maxclients)
#define DATABUF_RETURNS (3*maxclients)
//.float ctf_state;
//.float health;
-#define FONT_DEFAULT 0
-#define FONT_USER 8
+float FONT_DEFAULT = 0;
+float FONT_USER = 8;
// --------------------------------------------------------------------------
// Scoreboard stuff
-#define MAX_HUD_FIELDS 16
+const float MAX_HUD_FIELDS = 16;
-#define SP_END -1
+const float SP_END = -1;
-#define SP_PING -2
-#define SP_NAME -3
-#define SP_KDRATIO -4
-#define SP_CLRATIO -5
-#define SP_PL -6
-#define SP_FRAGS -7
-#define SP_SUM -8
+const float SP_PING = -2;
+const float SP_NAME = -3;
+const float SP_KDRATIO = -4;
+const float SP_CLRATIO = -5;
+const float SP_PL = -6;
+const float SP_FRAGS = -7;
+const float SP_SUM = -8;
-#define SP_SEPARATOR -100
+const float SP_SEPARATOR = -100;
float hud_field[MAX_HUD_FIELDS + 1];
float hud_size[MAX_HUD_FIELDS + 1];
void centerprint_hud(string strMessage);
void centerprint_generic(float new_id, string strMessage, float duration, float countdown_num);
-#define ALPHA_MIN_VISIBLE 0.003
+const float ALPHA_MIN_VISIBLE = 0.003;
float armorblockpercent;
//hooks
float calledhooks;
-#define HOOK_START 1
-#define HOOK_END 2
+const float HOOK_START = 1;
+const float HOOK_END = 2;
.float ping, ping_packetloss, ping_movementloss;
}
}
-#define NUM_SSDIRS 4
+const float NUM_SSDIRS = 4;
string ssdirs[NUM_SSDIRS];
float n_ssdirs;
void MapVote_Init()
}
-#define MAX_ACCURACY_LEVELS 10
+const float MAX_ACCURACY_LEVELS = 10;
float acc_lev[MAX_ACCURACY_LEVELS];
vector acc_col[MAX_ACCURACY_LEVELS];
float acc_col_loadtime;
return trace_fraction;
}
-#define MAX_CLIP_PLANES 5
+const float MAX_CLIP_PLANES = 5;
void _Movetype_Physics_Toss(float dt) // SV_Physics_Toss
{
if(self.move_flags & FL_ONGROUND)
.float skeleton_info_modelindex;
.float skeleton_info_skin;
-#define BONETYPE_LOWER 0
-#define BONETYPE_UPPER 1
-#define MAX_BONES 128
+const float BONETYPE_LOWER = 0;
+const float BONETYPE_UPPER = 1;
+const float MAX_BONES = 128;
.float skeleton_bonetype[MAX_BONES];
.float skeleton_numbones;
-#define MAX_TEAMRADAR_TIMES 32
+const float MAX_TEAMRADAR_TIMES = 32;
// to make entities have dots on the team radar
.float teamradar_icon;
-#define TUBA_MIN -18
-#define TUBA_MAX 27
-#define TUBA_INSTRUMENTS 3
+const float TUBA_MIN = -18;
+const float TUBA_MAX = 27;
+const float TUBA_INSTRUMENTS = 3;
#define TUBA_STARTNOTE(i,n) strcat("weapons/tuba", (i ? ftos(i) : ""), "_loopnote", ftos(n), ".wav")
.float note; // note
e.anim_melee_z = 0.001;
}
-#define ANIMPRIO_IDLE 0
-#define ANIMPRIO_ACTIVE 1
-#define ANIMPRIO_CROUCH 2
-#define ANIMPRIO_DEAD 3
+const float ANIMPRIO_IDLE = 0;
+const float ANIMPRIO_ACTIVE = 1;
+const float ANIMPRIO_CROUCH = 2;
+const float ANIMPRIO_DEAD = 3;
vector animdecide_getupperanim(entity e)
{
// explicit anim states (networked)
void animdecide_setstate(entity e, float newstate, float restart);
-#define ANIMSTATE_DEAD1 1 // base frames: die1
-#define ANIMSTATE_DEAD2 2 // base frames: die2
-#define ANIMSTATE_DUCK 4 // turns walk into duckwalk, jump into duckjump, etc.
-#define ANIMSTATE_FROZEN 8 // force idle
+const float ANIMSTATE_DEAD1 = 1; // base frames: die1
+const float ANIMSTATE_DEAD2 = 2; // base frames: die2
+const float ANIMSTATE_DUCK = 4; // turns walk into duckwalk, jump into duckjump, etc.
+const float ANIMSTATE_FROZEN = 8; // force idle
// implicit anim states (inferred from velocity, etc.)
-#define ANIMIMPLICITSTATE_INAIR 1
-#define ANIMIMPLICITSTATE_FORWARD 2
-#define ANIMIMPLICITSTATE_BACKWARDS 4
-#define ANIMIMPLICITSTATE_LEFT 8
-#define ANIMIMPLICITSTATE_RIGHT 16
-#define ANIMIMPLICITSTATE_JUMPRELEASED 32
+const float ANIMIMPLICITSTATE_INAIR = 1;
+const float ANIMIMPLICITSTATE_FORWARD = 2;
+const float ANIMIMPLICITSTATE_BACKWARDS = 4;
+const float ANIMIMPLICITSTATE_LEFT = 8;
+const float ANIMIMPLICITSTATE_RIGHT = 16;
+const float ANIMIMPLICITSTATE_JUMPRELEASED = 32;
// explicit actions (networked); negative values are for lower body
void animdecide_setaction(entity e, float action, float restart);
-#define ANIMACTION_JUMP -1 // jump
-#define ANIMACTION_DRAW 1 // draw
-#define ANIMACTION_PAIN1 2 // pain
-#define ANIMACTION_PAIN2 3 // pain
-#define ANIMACTION_SHOOT 4 // shoot
-#define ANIMACTION_TAUNT 5 // taunt
-#define ANIMACTION_MELEE 6 // melee
+const float ANIMACTION_JUMP = -1; // jump
+const float ANIMACTION_DRAW = 1; // draw
+const float ANIMACTION_PAIN1 = 2; // pain
+const float ANIMACTION_PAIN2 = 3; // pain
+const float ANIMACTION_SHOOT = 4; // shoot
+const float ANIMACTION_TAUNT = 5; // taunt
+const float ANIMACTION_MELEE = 6; // melee
// Last updated: December 28th, 2011
// ==========================================================
-#define NUM_MARKUPS 41
+const float NUM_MARKUPS = 41;
float markup_init;
string markup_from[NUM_MARKUPS];
string markup_to[NUM_MARKUPS];
// Last updated: December 28th, 2011
// =========================================================
-#define MAX_RPN_STACK 16
+const float MAX_RPN_STACK = 16;
float rpn_db;
float rpn_error;
float rpn_sp;
// =========================================================
// identifiers for subfunction requests by the command code structure
-#define CMD_REQUEST_COMMAND 1
-#define CMD_REQUEST_USAGE 2
\ No newline at end of file
+const float CMD_REQUEST_COMMAND = 1;
+const float CMD_REQUEST_USAGE = 2;
\ No newline at end of file
-// COMMIT-TODO: Update if necessary before committing
-// Revision 1: additional statistics sent (flag caps, returns, deaths)
-// Revision 2: Mapvote preview pictures
-// Revision 3: optimized map vote protocol
-// Revision 4: CSQC config var system
-// Revision 5: mapvote time fix
-// Revision 6: more robust against packet loss/delays, also show not yet connected clients
-// Revision 7: packet loss column
-// Revision 8: race
-// Revision 9: race delta
-// Revision 10: scoreboard force
-// Revision 11: scoreboard unforce; spectator support beginning
-// Revision 12: smaller scores updates (SERVER: requires new engine)
-// Revision 13: pointparticles
-// Revision 14: laser
-// Revision 15: zoom
-// Revision 16: multi-weapons
-// Revision 17: multi-weaponimpulses
-// Revision 18: warmup
-// Revision 19: fog
-// Revision 20: naggers
-// Revision 21: entcs for players optimized (position data down from 12 to 7 bytes); waypointsprites in csqc for team radar
-// Revision 22: hook shot origin
-#define CSQC_REVISION 22
-
const float AS_STRING = 1;
const float AS_INT = 2;
const float AS_FLOAT_TRUNCATED = 2;
// moved that here so the client knows the max.
// # of maps, I'll use arrays for them :P
-#define MAPVOTE_COUNT 30
+const float MAPVOTE_COUNT = 30;
/**
* Lower scores are better (e.g. suicides)
*/
-#define SFL_LOWER_IS_BETTER 1
+const float SFL_LOWER_IS_BETTER = 1;
/**
* Don't show zero values as scores
*/
-#define SFL_HIDE_ZERO 2
+const float SFL_HIDE_ZERO = 2;
/**
* Allow a column to be hidden (do not automatically add it even if it is a sorting key)
*/
-#define SFL_ALLOW_HIDE 16
+const float SFL_ALLOW_HIDE = 16;
/**
* Display as a rank (with st, nd, rd, th suffix)
*/
-#define SFL_RANK 32
+const float SFL_RANK = 32;
/**
* Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)
*/
-#define SFL_TIME 64
+const float SFL_TIME = 64;
// not an extra constant yet
#define SFL_ZERO_IS_WORST SFL_TIME
/**
* Scoring priority (NOTE: PRIMARY is used for fraglimit)
*/
-#define SFL_SORT_PRIO_SECONDARY 4
-#define SFL_SORT_PRIO_PRIMARY 8
-#define SFL_SORT_PRIO_MASK 12
+const float SFL_SORT_PRIO_SECONDARY = 4;
+const float SFL_SORT_PRIO_PRIMARY = 8;
+const float SFL_SORT_PRIO_MASK = 12;
/**
* Score indices
*/
-#define MAX_SCORE 10
-#define MAX_TEAMSCORE 2
-
-#define ST_SCORE 0
-#define SP_KILLS 0
-#define SP_DEATHS 1
-#define SP_SUICIDES 2
-#define SP_SCORE 3
+const float MAX_SCORE = 10;
+const float MAX_TEAMSCORE = 2;
+
+const float ST_SCORE = 0;
+const float SP_KILLS = 0;
+const float SP_DEATHS = 1;
+const float SP_SUICIDES = 2;
+const float SP_SCORE = 3;
// game mode specific indices are not in common/, but in server/scores_rules.qc!
const float CH_INFO = 0;
const float ATTEN_STATIC = 3;
const float ATTEN_MAX = 3.984375;
-#define VOL_BASE 0.7
-#define VOL_BASEVOICE 1.0
+const float VOL_BASE = 0.7;
+const float VOL_BASEVOICE = 1.0;
// WEAPONTODO: move this into separate/new projectile handling code // this sets sounds and other properties of the projectiles in csqc
const float PROJECTILE_ELECTRO = 1;
const float SPECIES_ROBOT_SHINY = 5;
const float SPECIES_RESERVED = 15;
-#define FRAGS_PLAYER 0
-#define FRAGS_SPECTATOR -666
-#define FRAGS_LMS_LOSER -616
-#define FRAGS_PLAYER_NONSOLID -616
+const float FRAGS_PLAYER = 0;
+const float FRAGS_SPECTATOR = -666;
+const float FRAGS_LMS_LOSER = -616;
+const float FRAGS_PLAYER_NONSOLID = -616;
// we can use this frags value for both
// water levels
const float WATERLEVEL_WETFEET = 1;
const float WATERLEVEL_SWIMMING = 2;
const float WATERLEVEL_SUBMERGED = 3;
-#define SERVERFLAG_ALLOW_FULLBRIGHT 1
-#define SERVERFLAG_TEAMPLAY 2
-#define SERVERFLAG_PLAYERSTATS 4
+const float SERVERFLAG_ALLOW_FULLBRIGHT = 1;
+const float SERVERFLAG_TEAMPLAY = 2;
+const float SERVERFLAG_PLAYERSTATS = 4;
// FIXME/EXPLAINME: why?
noref var vector autocvar_sv_player_maxs = '16 16 45';
#define PL_HEAD_z autocvar_sv_player_headsize_z
// spawnpoint prios
-#define SPAWN_PRIO_NEAR_TEAMMATE_FOUND 200
-#define SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM 100
-#define SPAWN_PRIO_RACE_PREVIOUS_SPAWN 50
-#define SPAWN_PRIO_GOOD_DISTANCE 10
+const float SPAWN_PRIO_NEAR_TEAMMATE_FOUND = 200;
+const float SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM = 100;
+const float SPAWN_PRIO_RACE_PREVIOUS_SPAWN = 50;
+const float SPAWN_PRIO_GOOD_DISTANCE = 10;
// URI handles
-#define URI_GET_DISCARD 0
-#define URI_GET_IPBAN 1
-#define URI_GET_IPBAN_END 16
-#define URI_GET_CURL 17
-#define URI_GET_CURL_END 32
-#define URI_GET_UPDATENOTIFICATION 33
-#define URI_GET_URLLIB 128
-#define URI_GET_URLLIB_END 191
+const float URI_GET_DISCARD = 0;
+const float URI_GET_IPBAN = 1;
+const float URI_GET_IPBAN_END = 16;
+const float URI_GET_CURL = 17;
+const float URI_GET_CURL_END = 32;
+const float URI_GET_UPDATENOTIFICATION = 33;
+const float URI_GET_URLLIB = 128;
+const float URI_GET_URLLIB_END = 191;
// gametype votes
-#define GTV_AVAILABLE 0
+const float GTV_AVAILABLE = 0;
// for later use in per-map gametype filtering
-#define GTV_FORBIDDEN 2
+const float GTV_FORBIDDEN = 2;
#define CSQCPLAYER_HOOK_POSTCAMERASETUP
// force updates of player entities that often even if unchanged
-#define CSQCPLAYER_FORCE_UPDATES 0.25
+const float CSQCPLAYER_FORCE_UPDATES = 0.25;
// mod must define:
//vector PL_MIN = ...;
// monster requests
-#define MR_SETUP 1 // (SERVER) setup monster data
-#define MR_THINK 2 // (SERVER) logic to run every frame
-#define MR_DEATH 3 // (SERVER) called when monster dies
-#define MR_PRECACHE 4 // (BOTH) precaches models/sounds used by this monster
+const float MR_SETUP = 1; // (SERVER) setup monster data
+const float MR_THINK = 2; // (SERVER) logic to run every frame
+const float MR_DEATH = 3; // (SERVER) called when monster dies
+const float MR_PRECACHE = 4; // (BOTH) precaches models/sounds used by this monster
// functions:
entity get_monsterinfo(float id);
void register_monsters_done();
const float MON_MAXCOUNT = 24;
-#define MON_FIRST 1
+const float MON_FIRST = 1;
float MON_COUNT;
float MON_LAST;
// ================================================
// main types/groups of notifications
-#define MSG_ANNCE 1 // "Global" AND "personal" announcer messages
-#define MSG_INFO 2 // "Global" information messages
-#define MSG_CENTER 3 // "Personal" centerprint messages
-#define MSG_CENTER_CPID 4 // Kill centerprint message
-#define MSG_MULTI 5 // Subcall MSG_INFO and/or MSG_CENTER notifications
-#define MSG_CHOICE 6 // Choose which subcall wrapper to activate
+const float MSG_ANNCE = 1; // "Global" AND "personal" announcer messages
+const float MSG_INFO = 2; // "Global" information messages
+const float MSG_CENTER = 3; // "Personal" centerprint messages
+const float MSG_CENTER_CPID = 4; // Kill centerprint message
+const float MSG_MULTI = 5; // Subcall MSG_INFO and/or MSG_CENTER notifications
+const float MSG_CHOICE = 6; // Choose which subcall wrapper to activate
// negative confirmations
-#define NO_MSG -12345 // allows various things to know when no information is added
-#define NOTIF_ABORT -1234 // allows Send_Notification to safely abort sending
+const float NO_MSG = -12345; // allows various things to know when no information is added
+const float NOTIF_ABORT = -1234; // allows Send_Notification to safely abort sending
#define EIGHT_VARS_TO_VARARGS_VARLIST \
VARITEM(1, 0, s1) \
#endif
#ifdef SVQC // SERVER ONLY
-#define NOTIF_ONE 1
-#define NOTIF_ONE_ONLY 2
-#define NOTIF_TEAM 3
-#define NOTIF_TEAM_EXCEPT 4
-#define NOTIF_ALL 5
-#define NOTIF_ALL_EXCEPT 6
+const float NOTIF_ONE = 1;
+const float NOTIF_ONE_ONLY = 2;
+const float NOTIF_TEAM = 3;
+const float NOTIF_TEAM_EXCEPT = 4;
+const float NOTIF_ALL = 5;
+const float NOTIF_ALL_EXCEPT = 6;
void Kill_Notification(
float broadcast, entity client,
death_team: show the full name of the team a player is switching from
*/
-#define NOTIF_MAX_ARGS 7
-#define NOTIF_MAX_HUDARGS 2
-#define NOTIF_MAX_DURCNT 2
+const float NOTIF_MAX_ARGS = 7;
+const float NOTIF_MAX_HUDARGS = 2;
+const float NOTIF_MAX_DURCNT = 2;
string arg_slot[NOTIF_MAX_ARGS];
-#define ARG_CS_SV_HA 1 // enabled on CSQC, SVQC, and Hudargs
-#define ARG_CS_SV_DC 2 // enabled on CSQC, SVQC, and durcnt centerprint
-#define ARG_CS_SV 3 // enabled on CSQC and SVQC
-#define ARG_CS 4 // unique result to CSQC
-#define ARG_SV 5 // unique result to SVQC
-#define ARG_DC 6 // unique result to durcnt/centerprint
+const float ARG_CS_SV_HA = 1; // enabled on CSQC, SVQC, and Hudargs
+const float ARG_CS_SV_DC = 2; // enabled on CSQC, SVQC, and durcnt centerprint
+const float ARG_CS_SV = 3; // enabled on CSQC and SVQC
+const float ARG_CS = 4; // unique result to CSQC
+const float ARG_SV = 5; // unique result to SVQC
+const float ARG_DC = 6; // unique result to durcnt/centerprint
// todo possible idea.... declare how many floats/strings each arg needs, and then dynamically increment the input
// this way, we don't need to have duplicates like i.e. s2loc and s3loc?
// ====================================
// notification counts
-#define NOTIF_FIRST 1
+const float NOTIF_FIRST = 1;
float NOTIF_ANNCE_COUNT;
float NOTIF_INFO_COUNT;
float NOTIF_CENTER_COUNT;
float NOTIF_CPID_COUNT;
// notification limits -- INCREASE AS NECESSARY
-#define NOTIF_ANNCE_MAX 100
-#define NOTIF_INFO_MAX 300
-#define NOTIF_CENTER_MAX 200
-#define NOTIF_MULTI_MAX 200
-#define NOTIF_CHOICE_MAX 20
+const float NOTIF_ANNCE_MAX = 100;
+const float NOTIF_INFO_MAX = 300;
+const float NOTIF_CENTER_MAX = 200;
+const float NOTIF_MULTI_MAX = 200;
+const float NOTIF_CHOICE_MAX = 20;
// notification entities
entity msg_annce_notifs[NOTIF_ANNCE_MAX];
string autocvar_g_playerstats_gamereport_ladder;
var string autocvar_g_playerstats_gamereport_uri = "http://stats.xonotic.org/stats/submit";
-#define PS_B_STATUS_ERROR -2
-#define PS_B_STATUS_IDLE -1
-#define PS_B_STATUS_WAITING 0
-#define PS_B_STATUS_RECEIVED 1
-#define PS_B_STATUS_UPDATING 2
+const float PS_B_STATUS_ERROR = -2;
+const float PS_B_STATUS_IDLE = -1;
+const float PS_B_STATUS_WAITING = 0;
+const float PS_B_STATUS_RECEIVED = 1;
+const float PS_B_STATUS_UPDATING = 2;
.float playerstats_basicstatus;
var string autocvar_g_playerstats_playerbasic_uri = "http://stats.xonotic.org";
#ifdef MENUQC
float PS_D_NEXTUPDATETIME;
float PS_D_LASTGAMECOUNT;
-#define PS_D_STATUS_ERROR -2
-#define PS_D_STATUS_IDLE -1
-#define PS_D_STATUS_WAITING 0
-#define PS_D_STATUS_RECEIVED 1
+const float PS_D_STATUS_ERROR = -2;
+const float PS_D_STATUS_IDLE = -1;
+const float PS_D_STATUS_WAITING = 0;
+const float PS_D_STATUS_RECEIVED = 1;
var float PlayerStats_PlayerDetail_Status = PS_D_STATUS_IDLE;
var string autocvar_g_playerstats_playerdetail_uri = "http://stats.xonotic.org/player/me";
var float autocvar_g_playerstats_playerdetail_autoupdatetime = 1800; // automatically update every 30 minutes anyway
// files
.float url_fh;
-#define URL_FH_CURL -1
-#define URL_FH_STDOUT -2
+const float URL_FH_CURL = -1;
+const float URL_FH_STDOUT = -2;
// URLs
.string url_url;
}
// Databases (hash tables)
-#define DB_BUCKETS 8192
+const float DB_BUCKETS = 8192;
void db_save(float db, string pFilename)
{
float fh, i, n;
cvar_settemp_restore(); // this must be done LAST, but in any case
}
-#define APPROXPASTTIME_ACCURACY_REQUIREMENT 0.05
+const float APPROXPASTTIME_ACCURACY_REQUIREMENT = 0.05;
#define APPROXPASTTIME_MAX (16384 * APPROXPASTTIME_ACCURACY_REQUIREMENT)
#define APPROXPASTTIME_RANGE (64 * APPROXPASTTIME_ACCURACY_REQUIREMENT)
// this will use the value:
string mmsss(float t);
string mmssss(float t);
-#define TIME_DECIMALS 2
-#define TIME_FACTOR 100
+const float TIME_DECIMALS = 2;
+const float TIME_FACTOR = 100;
#define TIME_ENCODED_TOSTRING(n) mmssss(n)
#define RACE_RECORD "/race100record/"
#define CTS_RECORD "/cts100record/"
string get_model_parameters_description;
string get_model_parameters_bone_upperbody;
string get_model_parameters_bone_weapon;
-#define MAX_AIM_BONES 4
+const float MAX_AIM_BONES = 4;
string get_model_parameters_bone_aim[MAX_AIM_BONES];
float get_model_parameters_bone_aimweight[MAX_AIM_BONES];
float get_model_parameters_fixbone;
#endif
#ifndef MENUQC
-#define CNT_NORMAL 1
-#define CNT_GAMESTART 2
-#define CNT_IDLE 3
-#define CNT_KILL 4
-#define CNT_RESPAWN 5
-#define CNT_ROUNDSTART 6
+const float CNT_NORMAL = 1;
+const float CNT_GAMESTART = 2;
+const float CNT_IDLE = 3;
+const float CNT_KILL = 4;
+const float CNT_RESPAWN = 5;
+const float CNT_ROUNDSTART = 6;
float Announcer_PickNumber(float type, float num);
#endif
float wep_config_file;
float wep_config_alsoprint;
-#define MAX_WEP_CONFIG 256
+const float MAX_WEP_CONFIG = 256;
float WEP_CONFIG_COUNT;
string wep_config_queue[MAX_WEP_CONFIG];
w_prop(id, sn, float, weaponthrowable, weaponthrowable)
#ifndef MENUQC
-#define ARC_MAX_SEGMENTS 20
+const float ARC_MAX_SEGMENTS = 20;
vector arc_shotorigin[4];
.vector beam_start;
.vector beam_dir;
.vector beam_wantdir;
.float beam_type;
-#define ARC_BT_MISS 0x00
-#define ARC_BT_WALL 0x01
-#define ARC_BT_HEAL 0x02
-#define ARC_BT_HIT 0x03
-#define ARC_BT_BURST_MISS 0x10
-#define ARC_BT_BURST_WALL 0x11
-#define ARC_BT_BURST_HEAL 0x12
-#define ARC_BT_BURST_HIT 0x13
-#define ARC_BT_BURSTMASK 0x10
-
-#define ARC_SF_SETTINGS 1
-#define ARC_SF_START 2
-#define ARC_SF_WANTDIR 4
-#define ARC_SF_BEAMDIR 8
-#define ARC_SF_BEAMTYPE 16
-#define ARC_SF_LOCALMASK 14
+const float ARC_BT_MISS = 0x00;
+const float ARC_BT_WALL = 0x01;
+const float ARC_BT_HEAL = 0x02;
+const float ARC_BT_HIT = 0x03;
+const float ARC_BT_BURST_MISS = 0x10;
+const float ARC_BT_BURST_WALL = 0x11;
+const float ARC_BT_BURST_HEAL = 0x12;
+const float ARC_BT_BURST_HIT = 0x13;
+const float ARC_BT_BURSTMASK = 0x10;
+
+const float ARC_SF_SETTINGS = 1;
+const float ARC_SF_START = 2;
+const float ARC_SF_WANTDIR = 4;
+const float ARC_SF_BEAMDIR = 8;
+const float ARC_SF_BEAMTYPE = 16;
+const float ARC_SF_LOCALMASK = 14;
#endif
#ifdef SVQC
ARC_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
weapon_defaultspawnfunc(WEP_SHOCKWAVE);
}
-#define MAX_SHOCKWAVE_HITS 10
+const float MAX_SHOCKWAVE_HITS = 10;
//#define DEBUG_SHOCKWAVE
.float swing_prev;
#endif
#ifdef CSQC
// WEAPONTODO: add client side settings for these
-#define SW_MAXALPHA 0.5
-#define SW_FADETIME 0.4
-#define SW_DISTTOMIN 200
+const float SW_MAXALPHA = 0.5;
+const float SW_FADETIME = 0.4;
+const float SW_DISTTOMIN = 200;
void Draw_Shockwave()
{
// fading/removal control
var float autocvar_cl_movement_errorcompensation = 0;
// engine stuff
-#define REFDEFFLAG_TELEPORTED 1
-#define REFDEFFLAG_JUMPING 2
+float REFDEFFLAG_TELEPORTED = 1;
+float REFDEFFLAG_JUMPING = 2;
float pmove_onground; // weird engine flag we shouldn't really use but have to for now
vector csqcplayer_origin, csqcplayer_velocity;
entity csqcplayer;
float csqcplayer_status;
-#define CSQCPLAYERSTATUS_UNPREDICTED 0
-#define CSQCPLAYERSTATUS_FROMSERVER 1
-#define CSQCPLAYERSTATUS_PREDICTED 2
+const float CSQCPLAYERSTATUS_UNPREDICTED = 0;
+const float CSQCPLAYERSTATUS_FROMSERVER = 1;
+const float CSQCPLAYERSTATUS_PREDICTED = 2;
// only ever READ these!
.float pmove_flags;
-#define PMF_JUMP_HELD 1
-#define PMF_DUCKED 4
-#define PMF_ONGROUND 8
+float PMF_JUMP_HELD = 1;
+float PMF_DUCKED = 4;
+float PMF_ONGROUND = 8;
void CSQCPlayer_SetCamera();
float CSQCPlayer_PreUpdate();
.float frame2time;
.float lerpfrac;
-#define CSQCMODEL_PROPERTY_FRAME 8388608
-#define CSQCMODEL_PROPERTY_TELEPORTED 4194304 // the "teleport bit" cancelling interpolation
-#define CSQCMODEL_PROPERTY_MODELINDEX 2097152
-#define CSQCMODEL_PROPERTY_ORIGIN 1048576
-#define CSQCMODEL_PROPERTY_YAW 524288
-#define CSQCMODEL_PROPERTY_PITCHROLL 262144
-#define CSQCMODEL_PROPERTY_FRAME2 131072
-#define CSQCMODEL_PROPERTY_LERPFRAC 65536
-#define CSQCMODEL_PROPERTY_SIZE 32768
+const float CSQCMODEL_PROPERTY_FRAME = 8388608;
+const float CSQCMODEL_PROPERTY_TELEPORTED = 4194304; // the "teleport bit" cancelling interpolation
+const float CSQCMODEL_PROPERTY_MODELINDEX = 2097152;
+const float CSQCMODEL_PROPERTY_ORIGIN = 1048576;
+const float CSQCMODEL_PROPERTY_YAW = 524288;
+const float CSQCMODEL_PROPERTY_PITCHROLL = 262144;
+const float CSQCMODEL_PROPERTY_FRAME2 = 131072;
+const float CSQCMODEL_PROPERTY_LERPFRAC = 65536;
+const float CSQCMODEL_PROPERTY_SIZE = 32768;
#define ALLPROPERTIES_COMMON \
CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_FRAME, float, ReadByte, WriteByte, frame) \
*/
.float iflags;
-#define IFLAG_VELOCITY 1
-#define IFLAG_ANGLES 2
-#define IFLAG_AUTOANGLES 4
-#define IFLAG_VALID 8
-#define IFLAG_PREVALID 16
-#define IFLAG_TELEPORTED 32
-#define IFLAG_AUTOVELOCITY 64
-#define IFLAG_V_ANGLE 128
-#define IFLAG_V_ANGLE_X 256
-#define IFLAG_ORIGIN 512
+const float IFLAG_VELOCITY = 1;
+const float IFLAG_ANGLES = 2;
+const float IFLAG_AUTOANGLES = 4;
+const float IFLAG_VALID = 8;
+const float IFLAG_PREVALID = 16;
+const float IFLAG_TELEPORTED = 32;
+const float IFLAG_AUTOVELOCITY = 64;
+const float IFLAG_V_ANGLE = 128;
+const float IFLAG_V_ANGLE_X = 256;
+const float IFLAG_ORIGIN = 512;
#define IFLAG_INTERNALMASK (IFLAG_VALID | IFLAG_PREVALID)
// call this BEFORE reading an entity update
#define CSQCPLAYER_HOOK_POSTCAMERASETUP
// force updates of player entities that often even if unchanged
-#define CSQCPLAYER_FORCE_UPDATES 0.25
+const float CSQCPLAYER_FORCE_UPDATES = 0.25;
// mod must define:
//vector PL_MIN = ...;
// assorted builtins
float drawsubpic(vector position, vector size, string pic, vector srcPosition, vector srcSize, vector rgb, float alpha, float flag) = #328;
vector drawgetimagesize(string pic) = #318;
-#define SPA_POSITION 0
-#define SPA_S_AXIS 1
-#define SPA_T_AXIS 2
-#define SPA_R_AXIS 3
-#define SPA_TEXCOORDS0 4
-#define SPA_LIGHTMAP0_TEXCOORDS 5
-#define SPA_LIGHTMAP_COLOR 6
+const float SPA_POSITION = 0;
+const float SPA_S_AXIS = 1;
+const float SPA_T_AXIS = 2;
+const float SPA_R_AXIS = 3;
+const float SPA_TEXCOORDS0 = 4;
+const float SPA_LIGHTMAP0_TEXCOORDS = 5;
+const float SPA_LIGHTMAP_COLOR = 6;
float (entity e, float s) getsurfacenumpoints = #434;
vector (entity e, float s, float n) getsurfacepoint = #435;
vector (entity e, float s) getsurfacenormal = #436;
float(float i) argv_start_index = #515;
float(float i) argv_end_index = #516;
string(float, float) getgamedirinfo = #626;
-#define GETGAMEDIRINFO_NAME 0
-#define GETGAMEDIRINFO_DESCRIPTION 1
+const float GETGAMEDIRINFO_NAME = 0;
+const float GETGAMEDIRINFO_DESCRIPTION = 1;
float log(float f) = #532;
string(string format, ...) sprintf = #627;
string(string s) strdecolorize = #477;
void InputBox_draw(entity me)
{
-#define CURSOR "_"
+ string CURSOR = "_";
float cursorPosInWidths, totalSizeInWidths;
if(me.pressed)
#ifdef IMPLEMENTATION
-#define CHARMAP_COLS 14
-#define CHARMAP_ROWS 10
+const float CHARMAP_COLS = 14;
+const float CHARMAP_ROWS = 10;
string CHARMAP =
"★◆■▮▰▬◣◤◥◢◀▲▶▼"
const string KEY_NOT_BOUND_CMD = "// not bound";
-#define MAX_KEYS_PER_FUNCTION 2
-#define MAX_KEYBINDS 256
+const float MAX_KEYS_PER_FUNCTION = 2;
+const float MAX_KEYBINDS = 256;
string Xonotic_KeyBinds_Functions[MAX_KEYBINDS];
string Xonotic_KeyBinds_Descriptions[MAX_KEYBINDS];
var float Xonotic_KeyBinds_Count = -1;
#ifdef IMPLEMENTATION
-#define LANGPARM_ID 0
-#define LANGPARM_NAME 1
-#define LANGPARM_NAME_LOCALIZED 2
-#define LANGPARM_PERCENTAGE 3
-#define LANGPARM_COUNT 4
+const float LANGPARM_ID = 0;
+const float LANGPARM_NAME = 1;
+const float LANGPARM_NAME_LOCALIZED = 2;
+const float LANGPARM_PERCENTAGE = 3;
+const float LANGPARM_COUNT = 4;
entity makeXonoticLanguageList()
{
#ifdef IMPLEMENTATION
-#define PLAYERPARM_SCORE 0
-#define PLAYERPARM_PING 1
-#define PLAYERPARM_TEAM 2
-#define PLAYERPARM_NAME 3
-#define PLAYERPARM_COUNT 4
+const float PLAYERPARM_SCORE = 0;
+const float PLAYERPARM_PING = 1;
+const float PLAYERPARM_TEAM = 2;
+const float PLAYERPARM_NAME = 3;
+const float PLAYERPARM_COUNT = 4;
entity makeXonoticPlayerList()
{
return me;
}
-#define BUFMODELS_TITLE 0
-#define BUFMODELS_IMAGE 1
-#define BUFMODELS_MODEL 2
-#define BUFMODELS_SKIN 3
-#define BUFMODELS_DESC 4
-#define BUFMODELS_COUNT 5
-
-#define XONVOTE186 1 // (nyov) removal of model text description
+const float BUFMODELS_TITLE = 0;
+const float BUFMODELS_IMAGE = 1;
+const float BUFMODELS_MODEL = 2;
+const float BUFMODELS_SKIN = 3;
+const float BUFMODELS_DESC = 4;
+const float BUFMODELS_COUNT = 5;
+
+const float XONVOTE186 = 1; // (nyov) removal of model text description
void XonoticPlayerModelSelector_configureXonoticPlayerModelSelector(entity me)
{
void ServerList_Update_favoriteButton(entity btn, entity me);
// fields for category entities
-#define MAX_CATEGORIES 9
-#define CATEGORY_FIRST 1
+const float MAX_CATEGORIES = 9;
+const float CATEGORY_FIRST = 1;
entity categories[MAX_CATEGORIES];
float category_ent_count;
.string cat_name;
theAlpha = 1;
p = gethostcachenumber(SLIST_FIELD_PING, i);
-#define PING_LOW 75
-#define PING_MED 200
-#define PING_HIGH 500
+ const float PING_LOW = 75;
+ const float PING_MED = 200;
+ const float PING_HIGH = 500;
if(p < PING_LOW)
theColor = SKINCOLOR_SERVERLIST_LOWPING + (SKINCOLOR_SERVERLIST_MEDPING - SKINCOLOR_SERVERLIST_LOWPING) * (p / PING_LOW);
else if(p < PING_MED)
#ifdef IMPLEMENTATION
-#define SKINPARM_NAME 0
-#define SKINPARM_TITLE 1
-#define SKINPARM_AUTHOR 2
-#define SKINPARM_PREVIEW 3
-#define SKINPARM_COUNT 4
+const float SKINPARM_NAME = 0;
+const float SKINPARM_TITLE = 1;
+const float SKINPARM_AUTHOR = 2;
+const float SKINPARM_PREVIEW = 3;
+const float SKINPARM_COUNT = 4;
entity makeXonoticSkinList()
{
-#define ANTILAG_MAX_ORIGINS 64
+const float ANTILAG_MAX_ORIGINS = 64;
.vector antilag_origins[ANTILAG_MAX_ORIGINS];
.float antilag_times[ANTILAG_MAX_ORIGINS];
.float antilag_index;
-#define HAVOCBOT_ONS_ROLE_NONE 0
-#define HAVOCBOT_ONS_ROLE_DEFENSE 2
-#define HAVOCBOT_ONS_ROLE_ASSISTANT 4
-#define HAVOCBOT_ONS_ROLE_OFFENSE 8
+const float HAVOCBOT_ONS_ROLE_NONE = 0;
+const float HAVOCBOT_ONS_ROLE_DEFENSE = 2;
+const float HAVOCBOT_ONS_ROLE_ASSISTANT = 4;
+const float HAVOCBOT_ONS_ROLE_OFFENSE = 8;
.float havocbot_role_flags;
.float havocbot_attack_time;
return 1;
}
-#define MAX_BOT_PLACES 4
+const float MAX_BOT_PLACES = 4;
.float bot_places_count;
.entity bot_places[MAX_BOT_PLACES];
.string bot_placenames[MAX_BOT_PLACES];
// NOTE: New commands should be added here. Do not forget to update BOT_CMD_COUNTER
-#define BOT_CMD_NULL 0
-#define BOT_CMD_PAUSE 1
-#define BOT_CMD_CONTINUE 2
-#define BOT_CMD_WAIT 3
-#define BOT_CMD_TURN 4
-#define BOT_CMD_MOVETO 5
-#define BOT_CMD_RESETGOAL 6 // Not implemented yet
-#define BOT_CMD_CC 7
-#define BOT_CMD_IF 8
-#define BOT_CMD_ELSE 9
-#define BOT_CMD_FI 10
-#define BOT_CMD_RESETAIM 11
-#define BOT_CMD_AIM 12
-#define BOT_CMD_PRESSKEY 13
-#define BOT_CMD_RELEASEKEY 14
-#define BOT_CMD_SELECTWEAPON 15
-#define BOT_CMD_IMPULSE 16
-#define BOT_CMD_WAIT_UNTIL 17
-#define BOT_CMD_MOVETOTARGET 18
-#define BOT_CMD_AIMTARGET 19
-#define BOT_CMD_BARRIER 20
-#define BOT_CMD_CONSOLE 21
-#define BOT_CMD_SOUND 22
-#define BOT_CMD_DEBUG_ASSERT_CANFIRE 23
-#define BOT_CMD_WHILE 24 // TODO: Not implemented yet
-#define BOT_CMD_WEND 25 // TODO: Not implemented yet
-#define BOT_CMD_CHASE 26 // TODO: Not implemented yet
-
-#define BOT_CMD_COUNTER 24 // Update this value if you add/remove a command
+const float BOT_CMD_NULL = 0;
+const float BOT_CMD_PAUSE = 1;
+const float BOT_CMD_CONTINUE = 2;
+const float BOT_CMD_WAIT = 3;
+const float BOT_CMD_TURN = 4;
+const float BOT_CMD_MOVETO = 5;
+const float BOT_CMD_RESETGOAL = 6; // Not implemented yet
+const float BOT_CMD_CC = 7;
+const float BOT_CMD_IF = 8;
+const float BOT_CMD_ELSE = 9;
+const float BOT_CMD_FI = 10;
+const float BOT_CMD_RESETAIM = 11;
+const float BOT_CMD_AIM = 12;
+const float BOT_CMD_PRESSKEY = 13;
+const float BOT_CMD_RELEASEKEY = 14;
+const float BOT_CMD_SELECTWEAPON = 15;
+const float BOT_CMD_IMPULSE = 16;
+const float BOT_CMD_WAIT_UNTIL = 17;
+const float BOT_CMD_MOVETOTARGET = 18;
+const float BOT_CMD_AIMTARGET = 19;
+const float BOT_CMD_BARRIER = 20;
+const float BOT_CMD_CONSOLE = 21;
+const float BOT_CMD_SOUND = 22;
+const float BOT_CMD_DEBUG_ASSERT_CANFIRE = 23;
+const float BOT_CMD_WHILE = 24; // TODO: Not implemented yet
+const float BOT_CMD_WEND = 25; // TODO: Not implemented yet
+const float BOT_CMD_CHASE = 26; // TODO: Not implemented yet
+
+const float BOT_CMD_COUNTER = 24; // Update this value if you add/remove a command
// NOTE: Following commands should be implemented on the bot ai
// If a new command should be handled by the target ai(s) please declare it here
.float() cmd_resetgoal;
//
-#define BOT_CMD_PARAMETER_NONE 0
-#define BOT_CMD_PARAMETER_FLOAT 1
-#define BOT_CMD_PARAMETER_STRING 2
-#define BOT_CMD_PARAMETER_VECTOR 3
+const float BOT_CMD_PARAMETER_NONE = 0;
+const float BOT_CMD_PARAMETER_FLOAT = 1;
+const float BOT_CMD_PARAMETER_STRING = 2;
+const float BOT_CMD_PARAMETER_VECTOR = 3;
float bot_cmds_initialized;
float bot_cmd_parm_type[BOT_CMD_COUNTER];
.float bot_cmd_condition_status;
-#define CMD_CONDITION_NONE 0
-#define CMD_CONDITION_TRUE 1
-#define CMD_CONDITION_FALSE 2
-#define CMD_CONDITION_TRUE_BLOCK 4
-#define CMD_CONDITION_FALSE_BLOCK 8
+const float CMD_CONDITION_NONE = 0;
+const float CMD_CONDITION_TRUE = 1;
+const float CMD_CONDITION_FALSE = 2;
+const float CMD_CONDITION_TRUE_BLOCK = 4;
+const float CMD_CONDITION_FALSE_BLOCK = 8;
float bot_cmd_eval(string expr)
{
.float bot_cmd_keys;
-#define BOT_CMD_KEY_NONE 0
-#define BOT_CMD_KEY_FORWARD 1
-#define BOT_CMD_KEY_BACKWARD 2
-#define BOT_CMD_KEY_RIGHT 4
-#define BOT_CMD_KEY_LEFT 8
-#define BOT_CMD_KEY_JUMP 16
-#define BOT_CMD_KEY_ATTACK1 32
-#define BOT_CMD_KEY_ATTACK2 64
-#define BOT_CMD_KEY_USE 128
-#define BOT_CMD_KEY_HOOK 256
-#define BOT_CMD_KEY_CROUCH 512
-#define BOT_CMD_KEY_CHAT 1024
+const float BOT_CMD_KEY_NONE = 0;
+const float BOT_CMD_KEY_FORWARD = 1;
+const float BOT_CMD_KEY_BACKWARD = 2;
+const float BOT_CMD_KEY_RIGHT = 4;
+const float BOT_CMD_KEY_LEFT = 8;
+const float BOT_CMD_KEY_JUMP = 16;
+const float BOT_CMD_KEY_ATTACK1 = 32;
+const float BOT_CMD_KEY_ATTACK2 = 64;
+const float BOT_CMD_KEY_USE = 128;
+const float BOT_CMD_KEY_HOOK = 256;
+const float BOT_CMD_KEY_CROUCH = 512;
+const float BOT_CMD_KEY_CHAT = 1024;
float bot_presskeys()
{
.float maycheat;
float gamestart_sv_cheats;
-#define CHIMPULSE_SPEEDRUN_INIT 30
-#define CHIMPULSE_GIVE_ALL 99
-#define CHIMPULSE_CLONE_MOVING 140
-#define CHIMPULSE_SPEEDRUN 141
-#define CHIMPULSE_CLONE_STANDING 142
-#define CHIMPULSE_TELEPORT 143
-#define CHIMPULSE_R00T 148
-
-#define CHRAME_DRAG 8
+const float CHIMPULSE_SPEEDRUN_INIT = 30;
+const float CHIMPULSE_GIVE_ALL = 99;
+const float CHIMPULSE_CLONE_MOVING = 140;
+const float CHIMPULSE_SPEEDRUN = 141;
+const float CHIMPULSE_CLONE_STANDING = 142;
+const float CHIMPULSE_TELEPORT = 143;
+const float CHIMPULSE_R00T = 148;
+
+const float CHRAME_DRAG = 8;
void CheatInit()
{
// ============================================================
// client verification results
-#define CLIENT_ACCEPTABLE 1
-#define CLIENT_DOESNT_EXIST -1
-#define CLIENT_NOT_REAL -2
-#define CLIENT_NOT_BOT -3
+const float CLIENT_ACCEPTABLE = 1;
+const float CLIENT_DOESNT_EXIST = -1;
+const float CLIENT_NOT_REAL = -2;
+const float CLIENT_NOT_BOT = -3;
// definitions for timeouts
-#define TIMEOUT_INACTIVE 0
-#define TIMEOUT_LEADTIME 1
-#define TIMEOUT_ACTIVE 2
+const float TIMEOUT_INACTIVE = 0;
+const float TIMEOUT_LEADTIME = 1;
+const float TIMEOUT_ACTIVE = 2;
// timeout which pauses the game by setting the slowmo value extremely low.
-#define TIMEOUT_SLOWMO_VALUE 0.0001
+const float TIMEOUT_SLOWMO_VALUE = 0.0001;
// global timeout information declarations
entity timeout_caller; // contains the entity of the player who started the last timeout
// ======================================================
// ladder bullshit todo
-#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
+const float LADDER_FIRSTPOINT = 100;
+const float LADDER_CNT = 10; // position X still gives LADDER_FIRSTPOINT/X points
+const float LADDER_SIZE = 30; // ladder shows the top X players
string top_uids[LADDER_SIZE];
float top_scores[LADDER_SIZE];
void race_deleteTime(string map, float pos);
-#define SHUFFLETEAMS_MAX_PLAYERS 255
-#define SHUFFLETEAMS_MAX_TEAMS 4
+const float SHUFFLETEAMS_MAX_PLAYERS = 255;
+const float SHUFFLETEAMS_MAX_TEAMS = 4;
float shuffleteams_players[SHUFFLETEAMS_MAX_PLAYERS]; // maximum of 255 player slots
float shuffleteams_teams[SHUFFLETEAMS_MAX_TEAMS]; // maximum of 4 teams
// ================================================
// definitions for command selection between progs
-#define VC_ASGNMNT_BOTH 1
-#define VC_ASGNMNT_CLIENTONLY 2
-#define VC_ASGNMNT_SERVERONLY 3
+const float VC_ASGNMNT_BOTH = 1;
+const float VC_ASGNMNT_CLIENTONLY = 2;
+const float VC_ASGNMNT_SERVERONLY = 3;
// vote selection definitions
-#define VOTE_SELECT_ABSTAIN -2
-#define VOTE_SELECT_REJECT -1
-#define VOTE_SELECT_NULL 0
-#define VOTE_SELECT_ACCEPT 1
+const float VOTE_SELECT_ABSTAIN = -2;
+const float VOTE_SELECT_REJECT = -1;
+const float VOTE_SELECT_NULL = 0;
+const float VOTE_SELECT_ACCEPT = 1;
// different statuses of the current vote
-#define VOTE_NULL 0
-#define VOTE_NORMAL 1
-#define VOTE_MASTER 2
+const float VOTE_NULL = 0;
+const float VOTE_NORMAL = 1;
+const float VOTE_MASTER = 2;
// global vote information declarations
entity vote_caller; // original caller of the current vote
void VoteCommand(float request, entity caller, float argc, string vote_command);
// warmup and nagger stuff
-#define RESTART_COUNTDOWN 10
+const float RESTART_COUNTDOWN = 10;
entity nagger;
float readycount; // amount of players who are ready
float readyrestart_happened; // keeps track of whether a restart has already happened
//.float chasecam;
.float damageforcescale;
-#define MIN_DAMAGEEXTRARADIUS 2
-#define MAX_DAMAGEEXTRARADIUS 16
+const float MIN_DAMAGEEXTRARADIUS = 2;
+const float MAX_DAMAGEEXTRARADIUS = 16;
.float damageextraradius;
//.float gravity;
// weapon states (self.weaponentity.state)
const float WS_CLEAR = 0; // no weapon selected
const float WS_RAISE = 1; // raise frame
-const float WS_DROP = 2; // deselecting frame
+const float WS_DROP = 2; // deselecting frame
const float WS_INUSE = 3; // fire state
const float WS_READY = 4; // idle frame
// there is 2 weapon tics that can run in one server frame
-#define W_TICSPERFRAME 2
+const float W_TICSPERFRAME = 2;
void weapon_defaultspawnfunc(float wpn);
.float version_nagtime;
-#define NUM_JUMPPADSUSED 3
+const float NUM_JUMPPADSUSED = 3;
.float jumppadcount;
.entity jumppadsused[NUM_JUMPPADSUSED];
string globalsound_step;
string globalsound_metalstep;
-#define VOICETYPE_PLAYERSOUND 10
-#define VOICETYPE_TEAMRADIO 11
-#define VOICETYPE_LASTATTACKER 12
-#define VOICETYPE_LASTATTACKER_ONLY 13
-#define VOICETYPE_AUTOTAUNT 14
-#define VOICETYPE_TAUNT 15
+const float VOICETYPE_PLAYERSOUND = 10;
+const float VOICETYPE_TEAMRADIO = 11;
+const float VOICETYPE_LASTATTACKER = 12;
+const float VOICETYPE_LASTATTACKER_ONLY = 13;
+const float VOICETYPE_AUTOTAUNT = 14;
+const float VOICETYPE_TAUNT = 15;
void PrecachePlayerSounds(string f);
void PrecacheGlobalSound(string samplestring);
.float ballistics_density; // wall piercing factor, larger = bullet can pass through more
-#define ACTIVE_NOT 0
-#define ACTIVE_ACTIVE 1
-#define ACTIVE_IDLE 2
-#define ACTIVE_BUSY 2
-#define ACTIVE_TOGGLE 3
+const float ACTIVE_NOT = 0;
+const float ACTIVE_ACTIVE = 1;
+const float ACTIVE_IDLE = 2;
+const float ACTIVE_BUSY = 2;
+const float ACTIVE_TOGGLE = 3;
.float active;
.void (float act_state) setactive;
.entity realowner;
string modname;
.float missile_flags;
-#define MIF_SPLASH 2
-#define MIF_ARC 4
-#define MIF_PROXY 8
-#define MIF_GUIDED_MANUAL 16
-#define MIF_GUIDED_HEAT 32
-#define MIF_GUIDED_LASER 64
-#define MIF_GUIDED_AI 128
-#define MIF_GUIDED_TAG 128
+const float MIF_SPLASH = 2;
+const float MIF_ARC = 4;
+const float MIF_PROXY = 8;
+const float MIF_GUIDED_MANUAL = 16;
+const float MIF_GUIDED_HEAT = 32;
+const float MIF_GUIDED_LASER = 64;
+const float MIF_GUIDED_AI = 128;
+const float MIF_GUIDED_TAG = 128;
#define MIF_GUIDED_ALL (MIF_GUIDED_MANUAL | MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG)
#define MIF_GUIDED_TRACKING (MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG)
#define MIF_GUIDED_CONFUSABLE (MIF_GUIDED_HEAT | MIF_GUIDED_AI)
-#define LATENCY_THINKRATE 10
+const float LATENCY_THINKRATE = 10;
.float latency_sum;
.float latency_cnt;
.float latency_time;
remove(self);
}
-#define BAN_MAX 256
+const float BAN_MAX = 256;
float ban_loaded;
string ban_ip[BAN_MAX];
float ban_expire[BAN_MAX];
float mapvote_keeptwotime;
float mapvote_timeout;
string mapvote_message;
-#define MAPVOTE_SCREENSHOT_DIRS_COUNT 4
+const float MAPVOTE_SCREENSHOT_DIRS_COUNT = 4;
string mapvote_screenshot_dirs[MAPVOTE_SCREENSHOT_DIRS_COUNT];
float mapvote_screenshot_dirs_count;
string precache_sound (string s) = #19;
float precache_sound_index (string s) = #19;
-#define SND_VOLUME 1
-#define SND_ATTENUATION 2
-#define SND_LARGEENTITY 8
-#define SND_LARGESOUND 16
+const float SND_VOLUME = 1;
+const float SND_ATTENUATION = 2;
+const float SND_LARGEENTITY = 8;
+const float SND_LARGESOUND = 16;
float sound_allowed(float dest, entity e)
{
#define EXACTTRIGGER_TOUCH if(WarpZoneLib_ExactTrigger_Touch()) return
#define EXACTTRIGGER_INIT WarpZoneLib_ExactTrigger_Init()
-#define INITPRIO_FIRST 0
-#define INITPRIO_GAMETYPE 0
-#define INITPRIO_GAMETYPE_FALLBACK 1
-#define INITPRIO_FINDTARGET 10
-#define INITPRIO_DROPTOFLOOR 20
-#define INITPRIO_SETLOCATION 90
-#define INITPRIO_LINKDOORS 91
-#define INITPRIO_LAST 99
+const float INITPRIO_FIRST = 0;
+const float INITPRIO_GAMETYPE = 0;
+const float INITPRIO_GAMETYPE_FALLBACK = 1;
+const float INITPRIO_FINDTARGET = 10;
+const float INITPRIO_DROPTOFLOOR = 20;
+const float INITPRIO_SETLOCATION = 90;
+const float INITPRIO_LINKDOORS = 91;
+const float INITPRIO_LAST = 99;
.void(void) initialize_entity;
.float initialize_entity_order;
return r; // callbacks return an error status, so 0 is default return value
}
-#define MAX_MUTATORS 15
+const float MAX_MUTATORS = 15;
string loaded_mutators[MAX_MUTATORS];
float Mutator_Add(mutatorfunc_t func, string name)
{
-#define CBC_ORDER_EXCLUSIVE 3
-#define CBC_ORDER_FIRST 1
-#define CBC_ORDER_LAST 2
-#define CBC_ORDER_ANY 4
+const float CBC_ORDER_EXCLUSIVE = 3;
+const float CBC_ORDER_FIRST = 1;
+const float CBC_ORDER_LAST = 2;
+const float CBC_ORDER_ANY = 4;
float CallbackChain_ReturnValue; // read-only field of the current return value
// }
float CallbackChain_Call(entity cb);
-#define MUTATOR_REMOVING 0
-#define MUTATOR_ADDING 1
-#define MUTATOR_ROLLING_BACK 2
+const float MUTATOR_REMOVING = 0;
+const float MUTATOR_ADDING = 1;
+const float MUTATOR_ROLLING_BACK = 2;
typedef float(float) mutatorfunc_t;
float Mutator_Add(mutatorfunc_t func, string name);
void Mutator_Remove(mutatorfunc_t func, string name); // calls error() on fail
// called at when a item is touched. Called early, can edit item properties.
entity self; // item
entity other; // player
- #define MUT_ITEMTOUCH_CONTINUE 0 // return this flag to make the function continue as normal
- #define MUT_ITEMTOUCH_RETURN 1 // return this flag to make the function return (handled entirely by mutator)
- #define MUT_ITEMTOUCH_PICKUP 2 // return this flag to have the item "picked up" and taken even after mutator handled it
+ const float MUT_ITEMTOUCH_CONTINUE = 0; // return this flag to make the function continue as normal
+ const float MUT_ITEMTOUCH_RETURN = 1; // return this flag to make the function return (handled entirely by mutator)
+ const float MUT_ITEMTOUCH_PICKUP = 2; // return this flag to have the item "picked up" and taken even after mutator handled it
MUTATOR_HOOKABLE(ClientConnect);
// called at when a player connect
// called when a target is checked for accuracy
entity frag_attacker; // attacker
entity frag_target; // target
- #define MUT_ACCADD_VALID 0 // return this flag to make the function continue if target is a client
- #define MUT_ACCADD_INVALID 1 // return this flag to make the function always continue
- #define MUT_ACCADD_INDIFFERENT 2 // return this flag to make the function always return
+ const float MUT_ACCADD_VALID = 0; // return this flag to make the function continue if target is a client
+ const float MUT_ACCADD_INVALID = 1; // return this flag to make the function always continue
+ const float MUT_ACCADD_INDIFFERENT = 2; // return this flag to make the function always return
.entity assault_sprite;
// legacy bot defs
-#define HAVOCBOT_AST_ROLE_NONE 0
-#define HAVOCBOT_AST_ROLE_DEFENSE 2
-#define HAVOCBOT_AST_ROLE_OFFENSE 4
+const float HAVOCBOT_AST_ROLE_NONE = 0;
+const float HAVOCBOT_AST_ROLE_DEFENSE = 2;
+const float HAVOCBOT_AST_ROLE_OFFENSE = 4;
.float havocbot_role_flags;
.float havocbot_attack_time;
void(float ratingscale, vector org, float sradius) havocbot_goalrating_enemyplayers;
// scoreboard stuff
-#define ST_ASSAULT_OBJECTIVES 1
-#define SP_ASSAULT_OBJECTIVES 4
+const float ST_ASSAULT_OBJECTIVES = 1;
+const float SP_ASSAULT_OBJECTIVES = 4;
// predefined spawnfuncs
void spawnfunc_func_breakable();
float ca_teams;
float allowed_to_spawn;
-#define ST_CA_ROUNDS 1
+const float ST_CA_ROUNDS = 1;
void ca_ScoreRules(float teams)
{
ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, TRUE);
void ctf_RespawnFlag(entity flag);
// score rule declarations
-#define ST_CTF_CAPS 1
-#define SP_CTF_CAPS 4
-#define SP_CTF_CAPTIME 5
-#define SP_CTF_PICKUPS 6
-#define SP_CTF_DROPS 7
-#define SP_CTF_FCKILLS 8
-#define SP_CTF_RETURNS 9
+const float ST_CTF_CAPS = 1;
+const float SP_CTF_CAPS = 4;
+const float SP_CTF_CAPTIME = 5;
+const float SP_CTF_PICKUPS = 6;
+const float SP_CTF_DROPS = 7;
+const float SP_CTF_FCKILLS = 8;
+const float SP_CTF_RETURNS = 9;
// flag constants // for most of these, there is just one question to be asked: WHYYYYY?
#define FLAG_MIN (PL_MIN + '0 0 -13')
#define FLAG_MAX (PL_MAX + '0 0 -13')
-#define FLAG_SCALE 0.6
+const float FLAG_SCALE = 0.6;
-#define FLAG_THINKRATE 0.2
-#define FLAG_TOUCHRATE 0.5
-#define WPFE_THINKRATE 0.5
+const float FLAG_THINKRATE = 0.2;
+const float FLAG_TOUCHRATE = 0.5;
+const float WPFE_THINKRATE = 0.5;
#define FLAG_DROP_OFFSET ('0 0 32')
#define FLAG_CARRY_OFFSET ('-16 0 8')
#define FLAG_PASS_ARC_OFFSET ('0 0 -10')
#define VEHICLE_FLAG_OFFSET ('0 0 96')
-#define VEHICLE_FLAG_SCALE 1.0
+const float VEHICLE_FLAG_SCALE = 1.0;
// waypoint colors
#define WPCOLOR_ENEMYFC(t) (colormapPaletteColor(t - 1, FALSE) * 0.75)
float wpforenemy_nextthink;
// statuses
-#define FLAG_BASE 1
-#define FLAG_DROPPED 2
-#define FLAG_CARRY 3
-#define FLAG_PASSING 4
+const float FLAG_BASE = 1;
+const float FLAG_DROPPED = 2;
+const float FLAG_CARRY = 3;
+const float FLAG_PASSING = 4;
-#define DROP_NORMAL 1
-#define DROP_THROW 2
-#define DROP_PASS 3
-#define DROP_RESET 4
+const float DROP_NORMAL = 1;
+const float DROP_THROW = 2;
+const float DROP_PASS = 3;
+const float DROP_RESET = 4;
-#define PICKUP_BASE 1
-#define PICKUP_DROPPED 2
+const float PICKUP_BASE = 1;
+const float PICKUP_DROPPED = 2;
-#define CAPTURE_NORMAL 1
-#define CAPTURE_DROPPED 2
+const float CAPTURE_NORMAL = 1;
+const float CAPTURE_DROPPED = 2;
-#define RETURN_TIMEOUT 1
-#define RETURN_DROPPED 2
-#define RETURN_DAMAGE 3
-#define RETURN_SPEEDRUN 4
-#define RETURN_NEEDKILL 5
+const float RETURN_TIMEOUT = 1;
+const float RETURN_DROPPED = 2;
+const float RETURN_DAMAGE = 3;
+const float RETURN_SPEEDRUN = 4;
+const float RETURN_NEEDKILL = 5;
// flag properties
#define ctf_spawnorigin dropped_origin
float ctf_captureshield_force; // push force of the shield
// bot player logic
-#define HAVOCBOT_CTF_ROLE_NONE 0
-#define HAVOCBOT_CTF_ROLE_DEFENSE 2
-#define HAVOCBOT_CTF_ROLE_MIDDLE 4
-#define HAVOCBOT_CTF_ROLE_OFFENSE 8
-#define HAVOCBOT_CTF_ROLE_CARRIER 16
-#define HAVOCBOT_CTF_ROLE_RETRIEVER 32
-#define HAVOCBOT_CTF_ROLE_ESCORT 64
+const float HAVOCBOT_CTF_ROLE_NONE = 0;
+const float HAVOCBOT_CTF_ROLE_DEFENSE = 2;
+const float HAVOCBOT_CTF_ROLE_MIDDLE = 4;
+const float HAVOCBOT_CTF_ROLE_OFFENSE = 8;
+const float HAVOCBOT_CTF_ROLE_CARRIER = 16;
+const float HAVOCBOT_CTF_ROLE_RETRIEVER = 32;
+const float HAVOCBOT_CTF_ROLE_ESCORT = 64;
.float havocbot_cantfindflag;
float g_race_qualifying;
// scores
-#define ST_CTS_LAPS 1
-#define SP_CTS_LAPS 4
-#define SP_CTS_TIME 5
-#define SP_CTS_FASTEST 6
+const float ST_CTS_LAPS = 1;
+const float SP_CTS_LAPS = 4;
+const float SP_CTS_TIME = 5;
+const float SP_CTS_FASTEST = 6;
// these are needed since mutators are compiled last
// score rule declarations
-#define ST_DOM_TICKS 1
-#define SP_DOM_TICKS 4
-#define SP_DOM_TAKES 5
-#define ST_DOM_CAPS 1
-#define SP_DOM_CAPS 4
+const float ST_DOM_TICKS = 1;
+const float SP_DOM_TICKS = 4;
+const float SP_DOM_TAKES = 5;
+const float ST_DOM_CAPS = 1;
+const float SP_DOM_CAPS = 4;
// pps: points per second
.float dom_total_pps;
.float freezetag_frozen_time;
.float freezetag_frozen_timeout;
-#define ICE_MAX_ALPHA 1
-#define ICE_MIN_ALPHA 0.1
+const float ICE_MAX_ALPHA = 1;
+const float ICE_MIN_ALPHA = 0.1;
float freezetag_teams;
-#define SP_FREEZETAG_REVIVALS 4
+const float SP_FREEZETAG_REVIVALS = 4;
void freezetag_ScoreRules(float teams)
{
ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE); // SFL_SORT_PRIO_PRIMARY
float inv_monsterskill;
-#define ST_INV_KILLS 1
+const float ST_INV_KILLS = 1;
entity ka_ball;
-#define SP_KEEPAWAY_PICKUPS 4
-#define SP_KEEPAWAY_CARRIERKILLS 5
-#define SP_KEEPAWAY_BCTIME 6
+const float SP_KEEPAWAY_PICKUPS = 4;
+const float SP_KEEPAWAY_CARRIERKILLS = 5;
+const float SP_KEEPAWAY_BCTIME = 6;
void() havocbot_role_ka_carrier;
void() havocbot_role_ka_collector;
float kh_key_dropped, kh_key_carried;
-#define ST_KH_CAPS 1
-#define SP_KH_CAPS 4
-#define SP_KH_PUSHES 5
-#define SP_KH_DESTROYS 6
-#define SP_KH_PICKUPS 7
-#define SP_KH_KCKILLS 8
-#define SP_KH_LOSSES 9
+const float ST_KH_CAPS = 1;
+const float SP_KH_CAPS = 4;
+const float SP_KH_PUSHES = 5;
+const float SP_KH_DESTROYS = 6;
+const float SP_KH_PICKUPS = 7;
+const float SP_KH_KCKILLS = 8;
+const float SP_KH_LOSSES = 9;
void kh_ScoreRules(float teams)
{
ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE);
// scoreboard stuff
-#define SP_LMS_LIVES 4
-#define SP_LMS_RANK 5
+const float SP_LMS_LIVES = 4;
+const float SP_LMS_RANK = 5;
// lives related defs
float lms_lowest_lives;
void basketball_touch();
void football_touch();
void ResetBall();
-#define NBM_NONE 0
-#define NBM_FOOTBALL 2
-#define NBM_BASKETBALL 4
+const float NBM_NONE = 0;
+const float NBM_FOOTBALL = 2;
+const float NBM_BASKETBALL = 4;
float nexball_mode;
float OtherTeam(float t) //works only if there are two teams on the map!
return e.team;
}
-#define ST_NEXBALL_GOALS 1
-#define SP_NEXBALL_GOALS 4
-#define SP_NEXBALL_FAULTS 5
+const float ST_NEXBALL_GOALS = 1;
+const float SP_NEXBALL_GOALS = 4;
+const float SP_NEXBALL_FAULTS = 5;
void nb_ScoreRules(float teams)
{
ScoreRules_basics(teams, 0, 0, TRUE);
//EF_BRIGHTFIELD|EF_BRIGHTLIGHT|EF_DIMLIGHT|EF_BLUE|EF_RED|EF_FLAME
-#define BALL_EFFECTMASK 1229
-#define BALL_MINS '-16 -16 -16' // The model is 24*24*24
-#define BALL_MAXS '16 16 16'
-#define BALL_ATTACHORG '3 0 16'
-#define BALL_SPRITECOLOR '.91 .85 .62'
-#define BALL_FOOT 1
-#define BALL_BASKET 2
+const float BALL_EFFECTMASK = 1229;
+const vector BALL_MINS = '-16 -16 -16'; // The model is 24*24*24
+const vector BALL_MAXS = '16 16 16';
+const vector BALL_ATTACHORG = '3 0 16';
+const vector BALL_SPRITECOLOR = '0.91 0.85 0.62';
+const float BALL_FOOT = 1;
+const float BALL_BASKET = 2;
//spawnflags
-#define GOAL_TOUCHPLAYER 1
+const float GOAL_TOUCHPLAYER = 1;
//goal types
-#define GOAL_FAULT -1
-#define GOAL_OUT -2
+const float GOAL_FAULT = -1;
+const float GOAL_OUT = -2;
void DropBall(entity ball, vector org, vector vel);
float autocvar_g_nexball_football_boost_forward;
float race_teams;
// scores
-#define ST_RACE_LAPS 1
-#define SP_RACE_LAPS 4
-#define SP_RACE_TIME 5
-#define SP_RACE_FASTEST 6
+const float ST_RACE_LAPS = 1;
+const float SP_RACE_LAPS = 4;
+const float SP_RACE_TIME = 5;
+const float SP_RACE_FASTEST = 6;
.float oldbuffs; // for updating effects
.entity buff_model; // controls effects (TODO: make csqc)
-#define BUFF_MIN ('-16 -16 -20')
-#define BUFF_MAX ('16 16 20')
+const vector BUFF_MIN = ('-16 -16 -20');
+const vector BUFF_MAX = ('16 16 20');
// client side options
.float cvar_cl_buffs_autoreplace;
.string new_toys;
float autocvar_g_new_toys_autoreplace;
-#define NT_AUTOREPLACE_NEVER 0
-#define NT_AUTOREPLACE_ALWAYS 1
-#define NT_AUTOREPLACE_RANDOM 2
+const float NT_AUTOREPLACE_NEVER = 0;
+const float NT_AUTOREPLACE_ALWAYS = 1;
+const float NT_AUTOREPLACE_RANDOM = 2;
MUTATOR_HOOKFUNCTION(nt_SetModname)
{
#define _SSMAGIX "SUPERSPEC_OPTIONSFILE_V1"
#define _ISLOCAL ((edict_num(1) == self) ? TRUE : FALSE)
-#define ASF_STRENGTH 1
-#define ASF_SHIELD 2
-#define ASF_MEGA_AR 4
-#define ASF_MEGA_HP 8
-#define ASF_FLAG_GRAB 16
-#define ASF_OBSERVER_ONLY 32
-#define ASF_SHOWWHAT 64
-#define ASF_SSIM 128
-#define ASF_FOLLOWKILLER 256
-#define ASF_ALL 0xFFFFFF
+const float ASF_STRENGTH = 1;
+const float ASF_SHIELD = 2;
+const float ASF_MEGA_AR = 4;
+const float ASF_MEGA_HP = 8;
+const float ASF_FLAG_GRAB = 16;
+const float ASF_OBSERVER_ONLY = 32;
+const float ASF_SHOWWHAT = 64;
+const float ASF_SSIM = 128;
+const float ASF_FOLLOWKILLER = 256;
+const float ASF_ALL = 0xFFFFFF;
.float autospec_flags;
-#define SSF_SILENT 1
-#define SSF_VERBOSE 2
-#define SSF_ITEMMSG 4
+const float SSF_SILENT = 1;
+const float SSF_VERBOSE = 2;
+const float SSF_ITEMMSG = 4;
.float superspec_flags;
.string superspec_itemfilter; //"classname1 classname2 ..."
}
//#define PATHLIB_USE_NODESCRAP
-#define PATHLIB_NODEEXPIRE 0.05
+const float PATHLIB_NODEEXPIRE = 0.05;
float pathlib_scraplist_cnt;
entity newnode()
{
}
//#define PATHLIB_NODEEXPIRE 0.05
-#define PATHLIB_NODEEXPIRE 20
+const float PATHLIB_NODEEXPIRE = 20;
void dumpnode(entity n)
{
#define inwater(point) (pointcontents(point) == CONTENT_WATER)
#define medium spawnshieldtime
-#define PLIB_FORWARD '0 1 0'
+const vector PLIB_FORWARD = '0 1 0';
//#define PLIB_BACK '0 -1 0'
-#define PLIB_RIGHT '1 0 0'
+const vector PLIB_RIGHT = '1 0 0';
//#define PLIB_LEFT '-1 0 0'
#define DEBUGPATHING
.float pathlib_node_f;
.float pathlib_node_c;
-#define pathlib_node_edgeflag_unknown 0
-#define pathlib_node_edgeflag_left 2
-#define pathlib_node_edgeflag_right 4
-#define pathlib_node_edgeflag_forward 8
-#define pathlib_node_edgeflag_back 16
-#define pathlib_node_edgeflag_backleft 32
-#define pathlib_node_edgeflag_backright 64
-#define pathlib_node_edgeflag_forwardleft 128
-#define pathlib_node_edgeflag_forwardright 256
-#define pathlib_node_edgeflag_none 512
+const float pathlib_node_edgeflag_unknown = 0;
+const float pathlib_node_edgeflag_left = 2;
+const float pathlib_node_edgeflag_right = 4;
+const float pathlib_node_edgeflag_forward = 8;
+const float pathlib_node_edgeflag_back = 16;
+const float pathlib_node_edgeflag_backleft = 32;
+const float pathlib_node_edgeflag_backright = 64;
+const float pathlib_node_edgeflag_forwardleft = 128;
+const float pathlib_node_edgeflag_forwardright = 256;
+const float pathlib_node_edgeflag_none = 512;
.float pathlib_node_edgeflags;
float pathlib_open_cnt;
float pathlib_foundgoal;
float pathlib_starttime;
-#define pathlib_maxtime 60
+const float pathlib_maxtime = 60;
entity best_open_node;
.float playerdemo_mode;
.float playerdemo_starttime;
.float playerdemo_time;
-#define PLAYERDEMO_MODE_OFF 0
-#define PLAYERDEMO_MODE_READING 1
-#define PLAYERDEMO_MODE_WRITING 2
+const float PLAYERDEMO_MODE_OFF = 0;
+const float PLAYERDEMO_MODE_READING = 1;
+const float PLAYERDEMO_MODE_WRITING = 2;
void playerdemo_init()
{
self.playerdemo_mode = PLAYERDEMO_MODE_OFF;
#define PORTALS_ARE_NOT_SOLID
-#define SAFENUDGE '1 1 1'
-#define SAFERNUDGE '8 8 8'
+const vector SAFENUDGE = '1 1 1';
+const vector SAFERNUDGE = '8 8 8';
.vector portal_transform;
.vector portal_safe_origin;
}
-#define MAX_CHECKPOINTS 255
+const float MAX_CHECKPOINTS = 255;
void spawnfunc_target_checkpoint();
return s;
}
-#define NAMEWIDTH 22
-#define SCORESWIDTH 58
+const float NAMEWIDTH = 22;
+const float SCORESWIDTH = 58;
// TODO put this somewhere in common?
string Score_NicePrint_ItemColor(float vflags)
{
const float AMMO_COUNT = 4; // amount of ammo types to show in the inventory panel
// item networking
-#define ISF_LOCATION 2
-#define ISF_MODEL 4
-#define ISF_STATUS 8
- #define ITS_STAYWEP 1
- #define ITS_ANIMATE1 2
- #define ITS_ANIMATE2 4
- #define ITS_AVAILABLE 8
- #define ITS_ALLOWFB 16
- #define ITS_ALLOWSI 32
- #define ITS_POWERUP 64
-#define ISF_COLORMAP 16
-#define ISF_DROP 32
-#define ISF_ANGLES 64
-#define ISF_SIZE 128
+const float ISF_LOCATION = 2;
+const float ISF_MODEL = 4;
+const float ISF_STATUS = 8;
+ const float ITS_STAYWEP = 1;
+ const float ITS_ANIMATE1 = 2;
+ const float ITS_ANIMATE2 = 4;
+ const float ITS_AVAILABLE = 8;
+ const float ITS_ALLOWFB = 16;
+ const float ITS_ALLOWSI = 32;
+ const float ITS_POWERUP = 64;
+const float ISF_COLORMAP = 16;
+const float ISF_DROP = 32;
+const float ISF_ANGLES = 64;
+const float ISF_SIZE = 128;
.float ItemStatus;
float have_pickup_item(void);
-#define ITEM_RESPAWN_TICKS 10
+const float ITEM_RESPAWN_TICKS = 10;
#define ITEM_RESPAWNTIME(i) ((i).respawntime + crandom() * (i).respawntimejitter)
// range: respawntime - respawntimejitter .. respawntime + respawntimejitter
void target_items_use (void);
-#define OP_SET 0
-#define OP_MIN 1
-#define OP_MAX 2
-#define OP_PLUS 3
-#define OP_MINUS 4
+const float OP_SET = 0;
+const float OP_MIN = 1;
+const float OP_MAX = 2;
+const float OP_PLUS = 3;
+const float OP_MINUS = 4;
float GiveWeapon(entity e, float wpn, float op, float val);
}
// spawnflags require key (for now only func_door)
-#define SPAWNFLAGS_GOLD_KEY 8
-#define SPAWNFLAGS_SILVER_KEY 16
+const float SPAWNFLAGS_GOLD_KEY = 8;
+const float SPAWNFLAGS_SILVER_KEY = 16;
void spawnfunc_func_door()
{
// Quake 1 keys compatibility
}
.entity pusher;
-#define TELEPORT_FLAG_SOUND 1
-#define TELEPORT_FLAG_PARTICLES 2
-#define TELEPORT_FLAG_TDEATH 4
-#define TELEPORT_FLAG_FORCE_TDEATH 8
+const float TELEPORT_FLAG_SOUND = 1;
+const float TELEPORT_FLAG_PARTICLES = 2;
+const float TELEPORT_FLAG_TDEATH = 4;
+const float TELEPORT_FLAG_FORCE_TDEATH = 8;
#define TELEPORT_FLAGS_WARPZONE 0
#define TELEPORT_FLAGS_PORTAL (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH | TELEPORT_FLAG_FORCE_TDEATH)
#define TELEPORT_FLAGS_TELEPORTER (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH)
// types for .teleportable entity setting
-#define TELEPORT_NORMAL 1 // play sounds/effects etc
-#define TELEPORT_SIMPLE 2 // only do teleport, nothing special
+const float TELEPORT_NORMAL = 1; // play sounds/effects etc
+const float TELEPORT_SIMPLE = 2; // only do teleport, nothing special
void Reset_ArcBeam(entity player, vector forward);
void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags)
.string cvar_basename;
//.float spawnflags
-#define TSF_SUSPENDED 1
+const float TSF_SUSPENDED = 1;
/// Spawn a pillar model under the turret to make it look ok on uneven ground surfaces
-#define TSF_TERRAINBASE 2
+const float TSF_TERRAINBASE = 2;
/// Disable builtin ammo regeneration
-#define TSF_NO_AMMO_REGEN 4
+const float TSF_NO_AMMO_REGEN = 4;
/// Dont break path to chase enemys. will still fire at them if possible.
-#define TSF_NO_PATHBREAK 8
+const float TSF_NO_PATHBREAK = 8;
/// Dont respawn
-#define TSL_NO_RESPAWN 16
+const float TSL_NO_RESPAWN = 16;
/// Let this turret roam when idle.
-#define TSL_ROAM 32
+const float TSL_ROAM = 32;
/// target selection flags
.float target_select_flags;
/// target validatoin flags
.float target_validate_flags;
/// Dont select a target on its own.
-#define TFL_TARGETSELECT_NO 2
+const float TFL_TARGETSELECT_NO = 2;
/// Need line of sight
-#define TFL_TARGETSELECT_LOS 4
+const float TFL_TARGETSELECT_LOS = 4;
/// Players are valid targets
-#define TFL_TARGETSELECT_PLAYERS 8
+const float TFL_TARGETSELECT_PLAYERS = 8;
/// Missiles are valid targets
-#define TFL_TARGETSELECT_MISSILES 16
+const float TFL_TARGETSELECT_MISSILES = 16;
/// Responds to turret_trigger_target events
-#define TFL_TARGETSELECT_TRIGGERTARGET 32
+const float TFL_TARGETSELECT_TRIGGERTARGET = 32;
/// Angular limitations of turret head limits target selection
-#define TFL_TARGETSELECT_ANGLELIMITS 64
+const float TFL_TARGETSELECT_ANGLELIMITS = 64;
/// Range limits apply in targetselection
-#define TFL_TARGETSELECT_RANGELIMTS 128
+const float TFL_TARGETSELECT_RANGELIMTS = 128;
/// DOnt select targets with a .team matching its own
-#define TFL_TARGETSELECT_TEAMCHECK 256
+const float TFL_TARGETSELECT_TEAMCHECK = 256;
/// Cant select targets on its own. needs to be triggerd or slaved.
-#define TFL_TARGETSELECT_NOBUILTIN 512
+const float TFL_TARGETSELECT_NOBUILTIN = 512;
/// TFL_TARGETSELECT_TEAMCHECK is inverted (selects only mebers of own .team)
-#define TFL_TARGETSELECT_OWNTEAM 1024
+const float TFL_TARGETSELECT_OWNTEAM = 1024;
/// Turrets aren't valid targets
-#define TFL_TARGETSELECT_NOTURRETS 2048
+const float TFL_TARGETSELECT_NOTURRETS = 2048;
/// Use feild of view
-#define TFL_TARGETSELECT_FOV 4096
+const float TFL_TARGETSELECT_FOV = 4096;
-#define TFL_TARGETSELECT_MISSILESONLY 8192
+const float TFL_TARGETSELECT_MISSILESONLY = 8192;
/// aim flags
.float aim_flags;
/// Dont aim.
-#define TFL_AIM_NO 1
+const float TFL_AIM_NO = 1;
/// Go for ground, not direct hit, but only if target is on ground.
-#define TFL_AIM_GROUNDGROUND 2
+const float TFL_AIM_GROUNDGROUND = 2;
/// Try to predict target movement (does not account for gravity)
-#define TFL_AIM_LEAD 4
+const float TFL_AIM_LEAD = 4;
/// Compensate for shot traveltime when lead
-#define TFL_AIM_SHOTTIMECOMPENSATE 8
+const float TFL_AIM_SHOTTIMECOMPENSATE = 8;
/// Try to do real prediction of targets z pos at impact.
-#define TFL_AIM_ZPREDICT 16
+const float TFL_AIM_ZPREDICT = 16;
/// Simply aim at target's current location
-#define TFL_AIM_SIMPLE 32
+const float TFL_AIM_SIMPLE = 32;
/// track (turn and pitch head) flags
.float track_flags;
/// Dont move head
-#define TFL_TRACK_NO 2
+const float TFL_TRACK_NO = 2;
/// Pitch the head
-#define TFL_TRACK_PITCH 4
+const float TFL_TRACK_PITCH = 4;
/// Rotate the head
-#define TFL_TRACK_ROT 8
+const float TFL_TRACK_ROT = 8;
/// How tracking is preformed
.float track_type;
/// Hard angle increments. Ugly for fast turning, best accuracy.
-#define TFL_TRACKTYPE_STEPMOTOR 1
+const float TFL_TRACKTYPE_STEPMOTOR = 1;
/// Smoth absolute movement. Looks ok, fair accuracy.
-#define TFL_TRACKTYPE_FLUIDPRECISE 2
+const float TFL_TRACKTYPE_FLUIDPRECISE = 2;
/// Simulated inertia. "Wobbly mode" Looks kool, can mean really bad accuracy depending on how the fields below are set
-#define TFL_TRACKTYPE_FLUIDINERTIA 3
+const float TFL_TRACKTYPE_FLUIDINERTIA = 3;
/// TFL_TRACKTYPE_FLUIDINERTIA: pitch multiplier
.float track_accel_pitch;
/// TFL_TRACKTYPE_FLUIDINERTIA: rotation multiplier
/// How prefire check is preformed
.float firecheck_flags;
/// Dont kill the dead
-#define TFL_FIRECHECK_DEAD 4
+const float TFL_FIRECHECK_DEAD = 4;
/// Range limits apply
-#define TFL_FIRECHECK_DISTANCES 8
+const float TFL_FIRECHECK_DISTANCES = 8;
/// Line Of Sight needs to be clear
-#define TFL_FIRECHECK_LOS 16
+const float TFL_FIRECHECK_LOS = 16;
/// Consider distance inpactpoint<->aimspot
-#define TFL_FIRECHECK_AIMDIST 32
+const float TFL_FIRECHECK_AIMDIST = 32;
/// Consider enemy origin<->impactpoint
-#define TFL_FIRECHECK_REALDIST 64
+const float TFL_FIRECHECK_REALDIST = 64;
/// Consider angular diff head<->aimspot
-#define TFL_FIRECHECK_ANGLEDIST 128
+const float TFL_FIRECHECK_ANGLEDIST = 128;
/// (re)consider target.team<->self.team
-#define TFL_FIRECHECK_TEAMCECK 256
+const float TFL_FIRECHECK_TEAMCECK = 256;
/// Try to avoid friendly fire
-#define TFL_FIRECHECK_AFF 512
+const float TFL_FIRECHECK_AFF = 512;
/// Own .ammo needs to be >= then own .shot_dmg
-#define TFL_FIRECHECK_OWM_AMMO 1024
+const float TFL_FIRECHECK_OWM_AMMO = 1024;
/// Others ammo need to be < others .ammo_max
-#define TFL_FIRECHECK_OTHER_AMMO 2048
+const float TFL_FIRECHECK_OTHER_AMMO = 2048;
/// Check own .attack_finished_single vs time
-#define TFL_FIRECHECK_REFIRE 4096
+const float TFL_FIRECHECK_REFIRE = 4096;
/// Move the acctual target to aimspot before tracing impact (and back after)
//#define TFL_FIRECHECK_VERIFIED 8192
/// Dont do any chekcs
-#define TFL_FIRECHECK_NO 16384
+const float TFL_FIRECHECK_NO = 16384;
/// How shooting is done
.float shoot_flags;
/// Dont shoot
-#define TFL_SHOOT_NO 64
+const float TFL_SHOOT_NO = 64;
/// Fire in vollys (partial implementation through .shot_volly)
-#define TFL_SHOOT_VOLLY 2
+const float TFL_SHOOT_VOLLY = 2;
/// Always do a full volly, even if target is lost or dead. (not implemented)
-#define TFL_SHOOT_VOLLYALWAYS 4
+const float TFL_SHOOT_VOLLYALWAYS = 4;
/// Loop though all valid tarters, and hit them.
-#define TFL_SHOOT_HITALLVALID 8
+const float TFL_SHOOT_HITALLVALID = 8;
/// Fiering makes unit loose target (after volly is done, if in volly mode)
-#define TFL_SHOOT_CLEARTARGET 16
+const float TFL_SHOOT_CLEARTARGET = 16;
///Custom shooting;
-#define TFL_SHOOT_CUSTOM 32
+const float TFL_SHOOT_CUSTOM = 32;
/// Information aboute the units capabilities
.float turrcaps_flags;
/// No kown capabilities
-#define TFL_TURRCAPS_NONE 0
+const float TFL_TURRCAPS_NONE = 0;
/// Capable of sniping
-#define TFL_TURRCAPS_SNIPER 2
+const float TFL_TURRCAPS_SNIPER = 2;
/// Capable of splasdamage
-#define TFL_TURRCAPS_RADIUSDMG 4
+const float TFL_TURRCAPS_RADIUSDMG = 4;
/// Has one or more cannons with zero shot traveltime
-#define TFL_TURRCAPS_HITSCAN 8
+const float TFL_TURRCAPS_HITSCAN = 8;
/// More then one (type of) gun
-#define TFL_TURRCAPS_MULTIGUN 16
+const float TFL_TURRCAPS_MULTIGUN = 16;
/// Carries at least one guided weapon
-#define TFL_TURRCAPS_GUIDED 32
+const float TFL_TURRCAPS_GUIDED = 32;
/// At least one gun fiers slow projectiles
-#define TFL_TURRCAPS_SLOWPROJ 64
+const float TFL_TURRCAPS_SLOWPROJ = 64;
/// At least one gun fiers medium speed projectiles
-#define TFL_TURRCAPS_MEDPROJ 128
+const float TFL_TURRCAPS_MEDPROJ = 128;
/// At least one gun fiers fast projectiles
-#define TFL_TURRCAPS_FASTPROJ 256
+const float TFL_TURRCAPS_FASTPROJ = 256;
/// At least one gun capable of damaging players
-#define TFL_TURRCAPS_PLAYERKILL 512
+const float TFL_TURRCAPS_PLAYERKILL = 512;
/// At least one gun that can shoot town missiles
-#define TFL_TURRCAPS_MISSILEKILL 1024
+const float TFL_TURRCAPS_MISSILEKILL = 1024;
/// Has support capabilities. powerplants and sutch.
-#define TFL_TURRCAPS_SUPPORT 2048
+const float TFL_TURRCAPS_SUPPORT = 2048;
/// Proveides at least one type of ammmo
-#define TFL_TURRCAPS_AMMOSOURCE 4096
+const float TFL_TURRCAPS_AMMOSOURCE = 4096;
/// Can recive targets from external sources
-#define TFL_TURRCAPS_RECIVETARGETS 8192
+const float TFL_TURRCAPS_RECIVETARGETS = 8192;
/// Capable of self-transport
-#define TFL_TURRCAPS_MOVE 16384
+const float TFL_TURRCAPS_MOVE = 16384;
/// Will roam arround even if not chasing anyting
-#define TFL_TURRCAPS_ROAM 32768
-#define TFL_TURRCAPS_ISTURRET 65536
+const float TFL_TURRCAPS_ROAM = 32768;
+const float TFL_TURRCAPS_ISTURRET = 65536;
/// Ammo types needed and/or provided
//.float ammo_flags;
#define ammo_flags currentammo
/// Has and needs no ammo
-#define TFL_AMMO_NONE 64
+const float TFL_AMMO_NONE = 64;
/// Uses power
-#define TFL_AMMO_ENERGY 2
+const float TFL_AMMO_ENERGY = 2;
/// Uses bullets
-#define TFL_AMMO_BULLETS 4
+const float TFL_AMMO_BULLETS = 4;
/// Uses explosives
-#define TFL_AMMO_ROCKETS 8
+const float TFL_AMMO_ROCKETS = 8;
/// Regenerates ammo on its own
-#define TFL_AMMO_RECHARGE 16
+const float TFL_AMMO_RECHARGE = 16;
/// Can recive ammo from others
-#define TFL_AMMO_RECIVE 32
+const float TFL_AMMO_RECIVE = 32;
/// How incomming damage is handeld
.float damage_flags;
/// Cant be hurt
-#define TFL_DMG_NO 256
+const float TFL_DMG_NO = 256;
/// Can be damaged
-#define TFL_DMG_YES 2
+const float TFL_DMG_YES = 2;
/// Can be damaged by teammates
-#define TFL_DMG_TAKEFROMTEAM 4
+const float TFL_DMG_TAKEFROMTEAM = 4;
/// Traget attackers
-#define TFL_DMG_RETALIATE 8
+const float TFL_DMG_RETALIATE = 8;
/// Target attackers, even is on own team
-#define TFL_DMG_RETALIATEONTEAM 16
+const float TFL_DMG_RETALIATEONTEAM = 16;
/// Loses target when damaged
-#define TFL_DMG_TARGETLOSS 32
+const float TFL_DMG_TARGETLOSS = 32;
/// Reciving damage trows off aim (pointless atm, aim gets recalculated to fast). not implemented.
-#define TFL_DMG_AIMSHAKE 64
+const float TFL_DMG_AIMSHAKE = 64;
/// Reciving damage slaps the head arround
-#define TFL_DMG_HEADSHAKE 128
+const float TFL_DMG_HEADSHAKE = 128;
/// Die and stay dead.
-#define TFL_DMG_DEATH_NORESPAWN 256
+const float TFL_DMG_DEATH_NORESPAWN = 256;
// Spawnflags
/// Spawn in teambased modes
-#define TFL_SPAWN_TEAM 2
+const float TFL_SPAWN_TEAM = 2;
/// Spawn in FFA modes
-#define TFL_SPAWN_FFA 4
+const float TFL_SPAWN_FFA = 4;
/*
-#define ewheel_amin_stop 0
-#define ewheel_amin_fwd_slow 1
-#define ewheel_amin_fwd_fast 2
-#define ewheel_amin_bck_slow 3
-#define ewheel_amin_bck_fast 4
+const float ewheel_amin_stop = 0;
+const float ewheel_amin_fwd_slow = 1;
+const float ewheel_amin_fwd_fast = 2;
+const float ewheel_amin_bck_slow = 3;
+const float ewheel_amin_bck_fast = 4;
void ewheel_attack()
{
-#define ANIM_NO 0
-#define ANIM_TURN 1
-#define ANIM_WALK 2
-#define ANIM_RUN 3
-#define ANIM_STRAFE_L 4
-#define ANIM_STRAFE_R 5
-#define ANIM_JUMP 6
-#define ANIM_LAND 7
-#define ANIM_PAIN 8
-#define ANIM_MEELE 9
-#define ANIM_SWIM 10
-#define ANIM_ROAM 11
+const float ANIM_NO = 0;
+const float ANIM_TURN = 1;
+const float ANIM_WALK = 2;
+const float ANIM_RUN = 3;
+const float ANIM_STRAFE_L = 4;
+const float ANIM_STRAFE_R = 5;
+const float ANIM_JUMP = 6;
+const float ANIM_LAND = 7;
+const float ANIM_PAIN = 8;
+const float ANIM_MEELE = 9;
+const float ANIM_SWIM = 10;
+const float ANIM_ROAM = 11;
.float animflag;
-#define WALKER_MIN '-70 -70 0'
-#define WALKER_MAX '70 70 95'
+const vector WALKER_MIN = '-70 -70 0';
+const vector WALKER_MAX = '70 70 95';
#define WALKER_PATH(s,e) pathlib_astar(s,e)
-#define BRG_SETUP 2
-#define BRG_START 4
-#define BRG_END 8
+const float BRG_SETUP = 2;
+const float BRG_START = 4;
+const float BRG_END = 8;
#ifdef SVQC
// Auto cvars
float bumble_raygun_send(entity to, float sf);
-#define BUMB_MIN '-130 -130 -130'
-#define BUMB_MAX '130 130 130'
+const vector BUMB_MIN = '-130 -130 -130';
+const vector BUMB_MAX = '130 130 130';
void bumb_fire_cannon(entity _gun, string _tagname, entity _owner)
{
-#define RACER_MIN '-120 -120 -40'
-#define RACER_MAX '120 120 40'
+const vector RACER_MIN = '-120 -120 -40';
+const vector RACER_MAX = '120 120 40';
#ifdef SVQC
void racer_exit(float eject);
-#define RSM_FIRST 0
-#define RSM_BOMB 0
-#define RSM_FLARE 1
-#define RSM_LAST 1
+const float RSM_FIRST = 0;
+const float RSM_BOMB = 0;
+const float RSM_FLARE = 1;
+const float RSM_LAST = 1;
-#define RAPTOR_MIN '-80 -80 0'
-#define RAPTOR_MAX '80 80 70'
+const vector RAPTOR_MIN = '-80 -80 0';
+const vector RAPTOR_MAX = '80 80 70';
#ifdef SVQC
float autocvar_g_vehicle_raptor;
void spiderbot_exit(float eject);
void spiderbot_enter();
void spiderbot_spawn(float);
-#define SBRM_FIRST 0
-#define SBRM_VOLLY 0
-#define SBRM_GUIDE 1
-#define SBRM_ARTILLERY 2
-#define SBRM_LAST 2
+const float SBRM_FIRST = 0;
+const float SBRM_VOLLY = 0;
+const float SBRM_GUIDE = 1;
+const float SBRM_ARTILLERY = 2;
+const float SBRM_LAST = 2;
void spiderbot_rocket_artillery()
{
.float vehicle_reload2; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real reload2 value.
.float sound_nexttime;
-#define VOL_VEHICLEENGINE 1
+const float VOL_VEHICLEENGINE = 1;
.float hud;
.float dmg_time;
.void() vehicle_enter; /// Vehicles custom funciton to be executed when owner exit it
.void() vehicle_die; /// Vehicles custom function to be executed when vehile die
-#define VHSF_NORMAL 0
-#define VHSF_FACTORY 2
+const float VHSF_NORMAL = 0;
+const float VHSF_FACTORY = 2;
.void(float _spawnflag) vehicle_spawn; /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
.float(float _imp) vehicles_impulse;
.float vehicle_weapon2mode = volly_counter;
// The commented-out functions need no implementation because DarkPlaces offers
// them as builtins. They are listed here anyway for completeness sake.
-#define FP_NAN 0
-#define FP_INFINITE 1
-#define FP_ZERO 2
-#define FP_SUBNORMAL 3
-#define FP_NORMAL 4
+const float FP_NAN = 0;
+const float FP_INFINITE = 1;
+const float FP_ZERO = 2;
+const float FP_SUBNORMAL = 3;
+const float FP_NORMAL = 4;
int fpclassify(float x);
int isfinite(float x);
int isinf(float x);
int islessgreater(float x, float y);
int isunordered(float x, float y);
-#define M_E 2.7182818284590452354 /* e */
-#define M_LOG2E 1.4426950408889634074 /* log_2 e */
-#define M_LOG10E 0.43429448190325182765 /* log_10 e */
-#define M_LN2 0.69314718055994530942 /* log_e 2 */
-#define M_LN10 2.30258509299404568402 /* log_e 10 */
-#define M_PI 3.14159265358979323846 /* pi */
-#define M_PI_2 1.57079632679489661923 /* pi/2 */
-#define M_PI_4 0.78539816339744830962 /* pi/4 */
-#define M_1_PI 0.31830988618379067154 /* 1/pi */
-#define M_2_PI 0.63661977236758134308 /* 2/pi */
-#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
-#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
-#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
+const float M_E = 2.7182818284590452354; /* e */
+const float M_LOG2E = 1.4426950408889634074; /* log_2 e */
+const float M_LOG10E = 0.43429448190325182765; /* log_10 e */
+const float M_LN2 = 0.69314718055994530942; /* log_e 2 */
+const float M_LN10 = 2.30258509299404568402; /* log_e 10 */
+const float M_PI = 3.14159265358979323846; /* pi */
+const float M_PI_2 = 1.57079632679489661923; /* pi/2 */
+const float M_PI_4 = 0.78539816339744830962; /* pi/4 */
+const float M_1_PI = 0.31830988618379067154; /* 1/pi */
+const float M_2_PI = 0.63661977236758134308; /* 2/pi */
+const float M_2_SQRTPI = 1.12837916709551257390; /* 2/sqrt(pi) */
+const float M_SQRT2 = 1.41421356237309504880; /* sqrt(2) */
+const float M_SQRT1_2 = 0.70710678118654752440; /* 1/sqrt(2) */