]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Turn #define'd constants into actual constants
authorMario <zacjardine@y7mail.com>
Sat, 24 Jan 2015 07:05:57 +0000 (18:05 +1100)
committerMario <zacjardine@y7mail.com>
Sat, 24 Jan 2015 07:05:57 +0000 (18:05 +1100)
93 files changed:
qcsrc/client/Defs.qc
qcsrc/client/View.qc
qcsrc/client/csqc_constants.qc
qcsrc/client/hud.qc
qcsrc/client/hud.qh
qcsrc/client/main.qh
qcsrc/client/mapvoting.qc
qcsrc/client/miscfunctions.qc
qcsrc/client/movetypes.qc
qcsrc/client/player_skeleton.qc
qcsrc/client/teamradar.qh
qcsrc/client/tuba.qc
qcsrc/common/animdecide.qc
qcsrc/common/animdecide.qh
qcsrc/common/command/markup.qh
qcsrc/common/command/rpn.qh
qcsrc/common/command/shared_defs.qh
qcsrc/common/constants.qh
qcsrc/common/csqcmodel_settings.qh
qcsrc/common/monsters/monsters.qh
qcsrc/common/notifications.qh
qcsrc/common/playerstats.qh
qcsrc/common/urllib.qc
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/common/weapons/config.qh
qcsrc/common/weapons/w_arc.qc
qcsrc/common/weapons/w_shockwave.qc
qcsrc/csqcmodellib/cl_player.qc
qcsrc/csqcmodellib/cl_player.qh
qcsrc/csqcmodellib/common.qh
qcsrc/csqcmodellib/interpolate.qh
qcsrc/csqcmodellib/settings.qh
qcsrc/dpdefs/csprogsdefs.qc
qcsrc/dpdefs/menudefs.qc
qcsrc/menu/item/inputbox.c
qcsrc/menu/xonotic/charmap.c
qcsrc/menu/xonotic/keybinder.c
qcsrc/menu/xonotic/languagelist.c
qcsrc/menu/xonotic/playerlist.c
qcsrc/menu/xonotic/playermodel.c
qcsrc/menu/xonotic/serverlist.c
qcsrc/menu/xonotic/skinlist.c
qcsrc/server/antilag.qc
qcsrc/server/bot/havocbot/role_onslaught.qc
qcsrc/server/bot/scripting.qc
qcsrc/server/cheats.qc
qcsrc/server/command/common.qh
qcsrc/server/command/getreplies.qh
qcsrc/server/command/sv_cmd.qh
qcsrc/server/command/vote.qh
qcsrc/server/defs.qh
qcsrc/server/g_world.qc
qcsrc/server/ipban.qc
qcsrc/server/mapvoting.qh
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/base.qc
qcsrc/server/mutators/base.qh
qcsrc/server/mutators/gamemode_assault.qh
qcsrc/server/mutators/gamemode_ca.qc
qcsrc/server/mutators/gamemode_ctf.qh
qcsrc/server/mutators/gamemode_cts.qh
qcsrc/server/mutators/gamemode_domination.qh
qcsrc/server/mutators/gamemode_freezetag.qc
qcsrc/server/mutators/gamemode_invasion.qh
qcsrc/server/mutators/gamemode_keepaway.qh
qcsrc/server/mutators/gamemode_keyhunt.qc
qcsrc/server/mutators/gamemode_lms.qh
qcsrc/server/mutators/gamemode_nexball.qc
qcsrc/server/mutators/gamemode_nexball.qh
qcsrc/server/mutators/gamemode_race.qh
qcsrc/server/mutators/mutator_buffs.qh
qcsrc/server/mutators/mutator_new_toys.qc
qcsrc/server/mutators/mutator_superspec.qc
qcsrc/server/pathlib.qc
qcsrc/server/pathlib/main.qc
qcsrc/server/pathlib/pathlib.qh
qcsrc/server/playerdemo.qc
qcsrc/server/portals.qc
qcsrc/server/race.qc
qcsrc/server/scores.qc
qcsrc/server/t_items.qh
qcsrc/server/t_plats.qc
qcsrc/server/t_teleporters.qc
qcsrc/server/tturrets/include/turrets_early.qh
qcsrc/server/tturrets/units/unit_ewheel.qc
qcsrc/server/tturrets/units/unit_walker.qc
qcsrc/server/vehicles/bumblebee.qc
qcsrc/server/vehicles/racer.qc
qcsrc/server/vehicles/raptor.qc
qcsrc/server/vehicles/spiderbot.qc
qcsrc/server/vehicles/vehicles_def.qh
qcsrc/warpzonelib/mathlib.qh

index 24a5fbfc0beb4532ed32ead7da6f43187ea09aad..0be5dc97d4f9dbbe041665c16b65ceb634a807b7 100644 (file)
@@ -235,8 +235,8 @@ float servertime, serverprevtime, serverdeltatime;
 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;
 
index 310b47d70def78e40a15d8873b5e964f7f0ba6b4..d3e60207cbba7e7cf928623bbec6819b30bf442a 100644 (file)
@@ -230,10 +230,10 @@ float wcross_ring_prev;
 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()
 {
@@ -373,7 +373,7 @@ void CSQC_RAPTOR_HUD();
 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;
@@ -963,8 +963,8 @@ void UpdateCrosshair()
        }
 }
 
-#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)
index 919fbc768068e39f7a365457fe10ce2b42968902..1794d6e42d73a08bdd0cc352f4fd774baa7fd912 100644 (file)
@@ -1,5 +1,3 @@
-#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;
@@ -123,12 +121,12 @@ const float BUTTON_14 = 65536;
 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
index 21dd0222b9ead829ba705088a04168d529f72479..23751b275e5c7696f65a0d03effa315f8267caac 100644 (file)
@@ -2068,8 +2068,8 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me)
 {
        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);
 
@@ -4085,9 +4085,9 @@ void HUD_Physics(void)
 
 // 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];
index d56caf1331e88fa48e9624f20b2cf7982c581f70..a4f9d4c769759cc19d57a2579bb4e3517197b9a0 100644 (file)
@@ -1,6 +1,6 @@
-#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;
 
@@ -338,8 +338,8 @@ panel_bg_border_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_bo
 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;
index c9aa2fb40f8a9e86b105dcf317edc9a49cd63f1d..87163482b2b6ebe24edf66b3615942f89bd3e164 100644 (file)
@@ -1,7 +1,7 @@
 // --------------------------------------------------------------------------
 // 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)
@@ -38,25 +38,25 @@ float gametype;
 //.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];
@@ -126,14 +126,14 @@ vector camera_direction;
 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;
 
index 3f30a6a722f7d3e805e6423facaca0b7ad81ab00..ac8d475529a1ef89900a7ef8287fcce8a114ea9f 100644 (file)
@@ -494,7 +494,7 @@ void MapVote_ReadMask()
        }
 }
 
-#define NUM_SSDIRS 4
+const float NUM_SSDIRS = 4;
 string ssdirs[NUM_SSDIRS];
 float n_ssdirs;
 void MapVote_Init()
index 8b674e7826c2ccd6529e46a703d55ee00a21a2ae..f14499f0ee75f8ccf7bb27b6a4f1e1b96ddb6737 100644 (file)
@@ -646,7 +646,7 @@ void draw_endBoldFont()
 }
 
 
-#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;
index 3d5c43509ea97441a01f7f4dfd7591a3fbd16f72..1c3487aca3466fa2a53bed634af6b4b5dd20e665 100644 (file)
@@ -277,7 +277,7 @@ float _Movetype_PushEntity(vector push, float failonstartsolid) // SV_PushEntity
        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)
index ad5e23aa88335e382a221201828870ad848af471..bec9c9ebe1dfd70cd454f8911fd113d4e33626d8 100644 (file)
@@ -1,8 +1,8 @@
 .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;
 
index 2dbdf89658898f756af81d33cf6c57d80e12c664..35ae44385b2fecdbb35b1cd0be4352026ba1a025 100644 (file)
@@ -1,4 +1,4 @@
-#define MAX_TEAMRADAR_TIMES 32
+const float MAX_TEAMRADAR_TIMES = 32;
 
 // to make entities have dots on the team radar
 .float teamradar_icon;
index 73d72b61e716c5ad200630d46b05365f217f74eb..cf8f881a0a535620431f0bfbf997d222475ff91e 100644 (file)
@@ -1,6 +1,6 @@
-#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
index d2b849f580e4832621dd5c16467dcbeb8cfb39cb..ca37d2b9ee236aec3558de74c6f3cd0500055b0a 100644 (file)
@@ -75,10 +75,10 @@ void animdecide_load_if_needed(entity e)
        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)
 {
index b9d5260e6e7449e6cdf57b73cab455d65111241f..cef7adddf82358cd21221e5e6c7a2f78cba78c6f 100644 (file)
@@ -23,25 +23,25 @@ void animdecide_setframes(entity e, float support_blending, .float fld_frame, .f
 
 // 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
index 6cf09d3ed4829c7c3bccd538b02ee4d08b6917bb..4193691b54c9b2009007549d6b885099a9463e82 100644 (file)
@@ -3,7 +3,7 @@
 //  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];
index 91b1dd9b9313e8873a3efc25885fddc4c49ba203..d182264c4f82f1df7449ee56596098a5404ccdfe 100644 (file)
@@ -3,7 +3,7 @@
 //  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;
index f06ee3239d67f3ddfccd7ad32545027a3addebf0..9e9e6da41757dbd29732e17d5a22af25c3780878 100644 (file)
@@ -4,5 +4,5 @@
 // =========================================================
 
 // 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
index 8586cffa9d539ff5f56067ab570df0e132f43ce6..083de41b608e22d42a7eec65b3bf5c3d8880eeac 100644 (file)
@@ -1,28 +1,3 @@
-// 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;
@@ -160,32 +135,32 @@ const vector eZ = '0 0 1';
 
 // 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
@@ -193,21 +168,21 @@ const vector eZ = '0 0 1';
 /**
  * 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;
@@ -235,8 +210,8 @@ const float ATTEN_IDLE = 2;
 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;
@@ -283,10 +258,10 @@ const float SPECIES_ROBOT_RUSTY = 4;
 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
@@ -294,9 +269,9 @@ const float WATERLEVEL_NONE = 0;
 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';
@@ -326,22 +301,22 @@ noref var vector autocvar_sv_player_headsize = '24 24 12';
 #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;
index f521d7de9da2b9635d7b13495a94711b1e612f47..16fd950b4e4bba8c56b954f0009c90fe42b6cb22 100644 (file)
@@ -62,7 +62,7 @@
 #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  = ...;
index c355e12a75a31b197fadd75476db33290f270564..4966d9518fcf464fe1b7d142a5991fc4325c9c2b 100644 (file)
@@ -1,8 +1,8 @@
 // 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);
@@ -39,7 +39,7 @@ void register_monster(float id, float(float) func, float monsterflags, vector mi
 void register_monsters_done();
 
 const float MON_MAXCOUNT = 24;
-#define MON_FIRST 1
+const float MON_FIRST = 1;
 float MON_COUNT;
 float MON_LAST;
 
index 0bfd2e5f3075f60746f5160b137ece590c4f43cc..fb4dc72308e6246e9b0645d162cd762e6d0660d3 100644 (file)
@@ -4,16 +4,16 @@
 // ================================================
 
 // 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) \
@@ -94,12 +94,12 @@ float prev_soundtime;
 #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,
@@ -1013,18 +1013,18 @@ var float autocvar_notification_show_sprees_center_specialonly = TRUE;
     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?
@@ -1270,7 +1270,7 @@ string notif_arg_spree_inf(float type, string input, string player, float spree)
 // ====================================
 
 // notification counts
-#define NOTIF_FIRST 1
+const float NOTIF_FIRST = 1;
 float NOTIF_ANNCE_COUNT;
 float NOTIF_INFO_COUNT;
 float NOTIF_CENTER_COUNT;
@@ -1279,11 +1279,11 @@ float NOTIF_CHOICE_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];
index ab4bc166f0b29f05134bf953f16a4ae75deb0c69..6a66380c2e81e502bd81f9f9810c08fe32e41da5 100644 (file)
@@ -87,11 +87,11 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status);
 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";
 
@@ -102,10 +102,10 @@ void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status);
 #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
index b747a27c468b2da7db99b678a15c66da1a9a0bf9..3349d5b24f1d1843d0fac9421198b7af65502cdb 100644 (file)
@@ -1,7 +1,7 @@
 // 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;
index db6f04c62e2eaacc803b2998572c3c2161359f90..e972b1d6ba1607548e265a6cf978edd5e7f653ba 100644 (file)
@@ -259,7 +259,7 @@ float fexists(string f)
 }
 
 // Databases (hash tables)
-#define DB_BUCKETS 8192
+const float DB_BUCKETS = 8192;
 void db_save(float db, string pFilename)
 {
        float fh, i, n;
@@ -2373,7 +2373,7 @@ void m_shutdown()
        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:
index 360aaec36b1114e4d7b1134bceb2d7723839225b..0fe0ff920156afeeefc0325862581e0e5ee85298 100644 (file)
@@ -99,8 +99,8 @@ string format_time(float seconds);
 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/"
@@ -265,7 +265,7 @@ float get_model_parameters_age;
 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;
@@ -423,12 +423,12 @@ void dedicated_print(string input);
 #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
 
index 6a0489314849cd47bfee81208355e02dd79a5852..efef821d89f79e5df742b0dea0d7fe9a1fd11fea 100644 (file)
@@ -6,7 +6,7 @@ void Dump_Weapon_Settings(void);
 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];
 
index 80fcf5524b15afed5294ed374eac22bfa73bef48..a32ce00f15e15589054b33fdfc257423c0a931e1 100644 (file)
@@ -55,29 +55,29 @@ REGISTER_WEAPON(
        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)
index 759dc35eaecbb4496924c3b1e25c492f4b26ab0c..ea7f3857239c21fdfd109ffacbb98f2611da6aa5 100644 (file)
@@ -93,7 +93,7 @@ void spawnfunc_weapon_shockwave(void)
        weapon_defaultspawnfunc(WEP_SHOCKWAVE);
 }
 
-#define MAX_SHOCKWAVE_HITS 10
+const float MAX_SHOCKWAVE_HITS = 10;
 //#define DEBUG_SHOCKWAVE
 
 .float swing_prev;
@@ -747,9 +747,9 @@ float W_Shockwave(float req)
 #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
index 63db0ac14b6ea777aef4e349f39e0d360682c9f5..19fa6b9bd81dfbddf6b555f391348fc4c6f03a72 100644 (file)
@@ -23,8 +23,8 @@
 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;
index 1cb42f2a5ce8383b6345546a038766ebcee7a6e8..ee1a6ac4d857883fa59753c2dc89a2b7c4682f48 100644 (file)
 
 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();
index 2c13404f5f6f6a4490d26c3a40a9c3011d5cb7e5..23db9ab3c90096fc213f5175173bb11a4fa286b8 100644 (file)
@@ -50,15 +50,15 @@ IN THE SOFTWARE.\
 .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) \
index 66bf491e57dd745378e9d939bf65b80e88d4d80e..535e3dae9f4b1e824dd89e45b415abd688d8eef2 100644 (file)
  */
 
 .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
index aab2a5637ccea77c2210dbd092bbe11b75d87741..34376c39368506e87bd24d15f528982f2e5cb208 100644 (file)
@@ -16,7 +16,7 @@
 #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  = ...;
index 50586fcc850ee2f781d247f7349ecddbbfb64bd6..a0e3966056edf8a207161f9863bd489ae0e4df36 100644 (file)
@@ -930,13 +930,13 @@ float REFDEFFLAG_INTERMISSION = 8;
 // 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;
index 58a2ef585fdc272b1d1622469fc4f1eefa7b9816..11129f50c43790e91e280c3bfe518df01650ff84 100644 (file)
@@ -527,8 +527,8 @@ float(string s) tokenize_console = #514;
 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;
index 1c1bf5189bc34a48a824a46f132e96e79e2f83cb..7708a0d7f9d287270996b9ca7b96d2157c1ac640 100644 (file)
@@ -214,7 +214,7 @@ float InputBox_keyDown(entity me, float key, float ascii, float shift)
 
 void InputBox_draw(entity me)
 {
-#define CURSOR "_"
+       string CURSOR = "_";
        float cursorPosInWidths, totalSizeInWidths;
 
        if(me.pressed)
index 686d9003467bd42b3f5a3ec9c7a029e48e68debd..5439c391d13e500b05162d09956cb2ae93787cec 100644 (file)
@@ -24,8 +24,8 @@ entity makeXonoticCharmap(entity controlledInputBox);
 
 #ifdef IMPLEMENTATION
 
-#define CHARMAP_COLS 14
-#define CHARMAP_ROWS 10
+const float CHARMAP_COLS = 14;
+const float CHARMAP_ROWS = 10;
 
 string CHARMAP =
        "★◆■▮▰▬◣◤◥◢◀▲▶▼"
index 60c44ddaf2436e8f6214b96c4641f0b54c46e3dc..6f3e56f72c8964d6f52aa6c62ed728eb1d5edc46 100644 (file)
@@ -34,8 +34,8 @@ void KeyBinder_Bind_Edit(entity btn, entity me);
 
 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;
index 38b8098ae0da2619d456ee0099e1c83a52fd271d..d34062d465d451770a5f66fdf0ecf65cb942d67b 100644 (file)
@@ -34,11 +34,11 @@ void SetLanguage_Click(entity btn, entity me);
 
 #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()
 {
index b3ee38670a04ad41117b82f3db7c0b2ee780b974..c60b34e380755073ebcd0f9203e38cfe82d6ab1e 100644 (file)
@@ -20,11 +20,11 @@ entity makeXonoticPlayerList();
 
 #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()
 {
index 652c581c00f6110e3cc66785d009adcb6cb89319..55e3b774697bea5ccd394fb2d0a3c0a56b623c83 100644 (file)
@@ -36,14 +36,14 @@ entity makeXonoticPlayerModelSelector()
        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)
 {
index c78cba0e0667c931bb7d5ed23b40a256adf0c4da..50ce594e8df0ff415b07d868a19218b487659e56 100644 (file)
@@ -126,8 +126,8 @@ void ServerList_Info_Click(entity btn, 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;
@@ -1074,9 +1074,9 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float
                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)
index 034fb2584098490d291fd2eb123160e02a21970f..6d11fe9c6574eaf510d2e94ab23b5446b07ced01 100644 (file)
@@ -33,11 +33,11 @@ void SetSkin_Click(entity btn, entity me);
 
 #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()
 {
index c53452ab78b352836a0614970259a54be27be59d..f95afc7a310c484e1edac8b4ccff1928f9f9187b 100644 (file)
@@ -1,4 +1,4 @@
-#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;
index dc942a38212fc4bbb0d47f77a3508df42798e517..bf5a6438934b309900e33a8f122f32c1ad4c970e 100644 (file)
@@ -1,7 +1,7 @@
-#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;
index f984f29b6b4facf819418946c15c6bfd8152d639..1770b4c63c90deb767ad13d5d9771387d9b9eaa3 100644 (file)
@@ -91,7 +91,7 @@ float bot_havecommand(entity bot, float idx)
        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];
@@ -138,35 +138,35 @@ entity bot_getplace(string placename)
 
 
 // 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
@@ -174,10 +174,10 @@ entity bot_getplace(string placename)
 .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];
@@ -650,11 +650,11 @@ float bot_cmd_select_weapon()
 
 .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)
 {
@@ -877,18 +877,18 @@ float bot_cmd_aimtarget()
 
 .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()
 {
index c1a637514275849c26b573a565e8fb499d9db86b..45e8a077efcdf923eee84a4cd73ef7fbd563cd03 100644 (file)
@@ -16,15 +16,15 @@ void Drag_MoveDrag(entity from, entity to) { }
 .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()
 {
index 589388bbad70d16faff12be3f5ae5dc418f0ce7b..13b260dbd0d8e77f98c25f87f3a3f6203ff642f0 100644 (file)
@@ -4,18 +4,18 @@
 // ============================================================
 
 // 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
index 583961d2246db10ce3907b411672100a92589b93..4a804309118d1bb5dd084647a9c38444d8950749 100644 (file)
@@ -4,9 +4,9 @@
 // ======================================================
 
 // 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];
index 03bd80cefc2f71fea3ddcdb4d7cbaa60bef1b2be..4b8c946a2e159f76b7b36faee83cf088a88ca908 100644 (file)
@@ -7,8 +7,8 @@ string GotoMap(string m);
 
 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
 
index 0386e1d5a187f033da2ffc6ab7a6f99ebf98a6e7..36da806196ccef8a25789573292d2d5f63e56d79 100644 (file)
@@ -4,20 +4,20 @@
 // ================================================
 
 // 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
@@ -41,7 +41,7 @@ void VoteReset();
 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
index 757ee65e2799449c1afd71e68aaf2339596faada..9c6d35e819f43d63351cb8d77c3827af3997cd3d 100644 (file)
@@ -138,8 +138,8 @@ void setanim(entity e, vector anim, float looping, float override, float restart
 //.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;
@@ -196,12 +196,12 @@ void w_ready();
 // 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);
 
@@ -279,7 +279,7 @@ float default_weapon_alpha;
 
 .float version_nagtime;
 
-#define NUM_JUMPPADSUSED 3
+const float NUM_JUMPPADSUSED = 3;
 .float jumppadcount;
 .entity jumppadsused[NUM_JUMPPADSUSED];
 
@@ -394,12 +394,12 @@ string globalsound_metalfall;
 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);
@@ -556,11 +556,11 @@ string deathmessage;
 
 .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;
@@ -594,14 +594,14 @@ typedef vector(entity player, entity spot, vector current) spawn_evalfunc_t;
 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)
index 0fd5d2de3c2eee8f0e2a8076f22ee753b6965992..2a706754b9a85d0a10ca5a56ed1d6598c10ba3d4 100644 (file)
@@ -1,4 +1,4 @@
-#define LATENCY_THINKRATE 10
+const float LATENCY_THINKRATE = 10;
 .float latency_sum;
 .float latency_cnt;
 .float latency_time;
index d3d7fdca6e93aa87ad5db6b41f5261891672ff0a..5a3bed86da709e0e3b38c19c14918012fc4558e3 100644 (file)
@@ -238,7 +238,7 @@ void OnlineBanList_Think()
        remove(self);
 }
 
-#define BAN_MAX 256
+const float BAN_MAX = 256;
 float ban_loaded;
 string ban_ip[BAN_MAX];
 float ban_expire[BAN_MAX];
index 6875958bfe464aa54ce11fd6f6d3a9d12189fbd1..33e03f8e27cdc2d9845423f5b7cb43ecabd471dd 100644 (file)
@@ -16,7 +16,7 @@ float mapvote_initialized;
 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;
 
index e6fda399e27eb0427e90a241964f623843a54feb..803561245fabb3dae283fd1133674f1c78b1473e 100644 (file)
@@ -1037,10 +1037,10 @@ void readlevelcvars(void)
 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)
 {
@@ -1393,14 +1393,14 @@ void precache()
 #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;
index 1ba8f2663e730b8796da2e6fb8cd3b1592d61eb0..e13919a23b174b5372f301b06070bfe31c0182df 100644 (file)
@@ -91,7 +91,7 @@ float CallbackChain_Call(entity cb)
        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)
 {
index 1c33e39739af41cf886143ee6aacdce77ec75b98..3ea2068597d4cbe38f27a10400538b3955d0b726 100644 (file)
@@ -1,7 +1,7 @@
-#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
 
@@ -16,9 +16,9 @@ float CallbackChain_Remove(entity cb, float() func);
 // }
 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
@@ -356,9 +356,9 @@ MUTATOR_HOOKABLE(ItemTouch);
        // 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
@@ -371,6 +371,6 @@ MUTATOR_HOOKABLE(AccuracyTargetValid);
        // 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
index 9aecf87f29824919cefe61c6f6cb79ca6d4f4a68..00b8e98a567c88bc704be85693e77caf3655f71a 100644 (file)
@@ -3,9 +3,9 @@
 .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;
@@ -23,8 +23,8 @@ void(float ratingscale, vector org, float sradius) havocbot_goalrating_items;
 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();
index 4ba1830048ec4f7733aa62454842e816b4c8c082..79ad7213071eb707f47bfa7607b3f02d1034e738 100644 (file)
@@ -4,7 +4,7 @@ float redalive, bluealive, yellowalive, pinkalive;
 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);
index ca4961eddc24231a6056943a0b2bffcdb5dcec06..86ff40dcc862843c0199e6bac724a8b18b77e886 100644 (file)
@@ -5,23 +5,23 @@
 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')
@@ -31,7 +31,7 @@ void ctf_RespawnFlag(entity flag);
 #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)
@@ -69,27 +69,27 @@ float wpforenemy_announced;
 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
@@ -117,13 +117,13 @@ float ctf_captureshield_max_ratio; // punish at most 30% of each team
 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;
 
index f02caf01fae1bf99341f93a8fd101362048d5abf..9d6953bcbe5178f910b8f3d8cafa155b3f7b711f 100644 (file)
@@ -1,7 +1,7 @@
 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;
index 6b5b334e4906ef969597e3600070d172e8ecb49e..a0cd99e1cc0c317453de0d450becad565cbf2646 100644 (file)
@@ -1,11 +1,11 @@
 // 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;
index 5ab96277b9e4a286a04999ab8c0832fb09d0fdc2..70de31fe3df2407eb7ee84c55ee03fcff02390da 100644 (file)
@@ -1,10 +1,10 @@
 .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
index 04492d4a345824652998afe8d413af6ea9e42082..aa28a2517d612ba9b7463dca350bcefaaf000bbc 100644 (file)
@@ -11,4 +11,4 @@ float inv_monsters_perteam[17];
 
 float inv_monsterskill;
 
-#define ST_INV_KILLS 1
+const float ST_INV_KILLS = 1;
index 062fc9e0cb2325b46663c480263efd72fd04d62d..98b492e55d1a845744aef3b076a34f7d59b6a03e 100644 (file)
@@ -2,9 +2,9 @@
 
 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;
index 7b3ea98af6dc0dc558224870e604164259e969d3..c5cd477aa418a9fc4be83bf3a5c8ba2218d34520 100644 (file)
@@ -67,13 +67,13 @@ string kh_sound_alarm = "kh/alarm.wav";  // the new siren/alarm
 
 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);
index 16fda61550823e6a098e27a2f47e1cfe2506550d..195c4aac3f9174e74eef5c4347a344a1818293f6 100644 (file)
@@ -1,6 +1,6 @@
 // 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;
index 346ae1eee4493eed30b0649d18a2747d8d824e23..92e707b061948c84ca2598c90bde7f42bfde3732 100644 (file)
@@ -8,9 +8,9 @@ vector autocvar_g_nexball_viewmodel_offset;
 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!
@@ -22,9 +22,9 @@ 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);
index 4b0b7eaa15c67a3dd686ce2e00474803730684a8..5a01d4073cdfdefc5afd16e8533ca4eca7ada9c3 100644 (file)
@@ -1,16 +1,16 @@
 //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;
index 32829a25c9166bd70905b5785f75c4067ca007e5..b8b052daaa880aa1e317e896ee1ff9ec8a55ed1b 100644 (file)
@@ -2,7 +2,7 @@ float g_race_qualifying;
 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;
index 66540b87604e3a5b897a25cd019a16f36ff716be..c96485006b0d06b6517555778567748a2cfd1e49 100644 (file)
@@ -21,8 +21,8 @@ const float STAT_MOVEVARS_JUMPVELOCITY = 250; // engine hack
 .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;
index 3e41c42fe022215ae6152a92b0eb7a7a0ff48065..56d38c2446861816d4696140bdff22b323e46193 100644 (file)
@@ -69,9 +69,9 @@ roflsound "New toys, new toys!" sound.
 .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)
 {
index 74e17a6a1422fb5b97bb989920dfdb8fa8a13891..161439d953a7675d95805956e4f310ed9b48d4fe 100644 (file)
@@ -1,21 +1,21 @@
 #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 ..."
index d1f5fd35845803996429f922873b37fb7a254986..5a629e9ab018d823a9d0ac3ad7f06496cc3ac993 100644 (file)
@@ -520,7 +520,7 @@ float pathlib_h_diagonal3(vector a,vector b)
 }
 
 //#define PATHLIB_USE_NODESCRAP
-#define PATHLIB_NODEEXPIRE 0.05
+const float PATHLIB_NODEEXPIRE = 0.05;
 float pathlib_scraplist_cnt;
 entity newnode()
 {
index 589ff82a1122f000df835f78d1d4d9e2f8fe26d1..897c0005d9f75b3b6c227e10888ac2cb384406a5 100644 (file)
@@ -12,7 +12,7 @@ void pathlib_deletepath(entity start)
 }
 
 //#define PATHLIB_NODEEXPIRE 0.05
-#define PATHLIB_NODEEXPIRE 20
+const float PATHLIB_NODEEXPIRE = 20;
 
 void dumpnode(entity n)
 {
index d1b6667d715f4a6075f992f999ceb846a608e339..55bd95dbd831d9039d7729c98a02d22f0ad4c60b 100644 (file)
@@ -5,9 +5,9 @@
 #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
@@ -28,16 +28,16 @@ entity start_node;
 .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;
@@ -55,7 +55,7 @@ float pathlib_movecost_waterfactor;
 float pathlib_foundgoal;
 
 float pathlib_starttime;
-#define pathlib_maxtime 60
+const float pathlib_maxtime = 60;
 
 entity best_open_node;
 
index 631c10dcbb67fb36bacf638882abe4710f70a76f..b848cfac767a5b44612c70d65bd5e2bdd82eb2c3 100644 (file)
@@ -2,9 +2,9 @@
 .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;
index aff0652d4a569061d7fb39a43d654185f264b229..28cbfdaff8396bfdf65caaefb92ec268cef7a004 100644 (file)
@@ -1,7 +1,7 @@
 #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;
index 1c12058d0d9019ee4bb0ae36366a4db58c588c96..f3748f9ce2a6c2b2b733433d7c89db5033f6bb71 100644 (file)
@@ -67,7 +67,7 @@ string race_readName(string map, float pos)
 }
 
 
-#define MAX_CHECKPOINTS 255
+const float MAX_CHECKPOINTS = 255;
 
 void spawnfunc_target_checkpoint();
 
index 620ce8ce50e3a4a38812ab85b38b8fc1b2c4b195..bd83f0b69433bb7bc33ffce739def8d0410b2a98 100644 (file)
@@ -773,8 +773,8 @@ float TeamScore_GetCompareValue(float t)
        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)
 {
index 13cc3796fe1a0539a3bd779e0efec7971f21cdfb..9db934196c5ae012549c289687325cd57bc7aff1 100644 (file)
@@ -44,20 +44,20 @@ const      float IT_UNLIMITED_AMMO            =       3; // IT_UNLIMITED_SUPERWE
 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;
 
@@ -88,7 +88,7 @@ float ItemSend(entity to, float sf);
 
 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
@@ -142,11 +142,11 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
 
 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);
 
index 315abe152f50b2d9074b28d1e214fa8d1f199053..e3e962a1dc8901c760458a4fb91120ebbe183f1f 100644 (file)
@@ -1480,8 +1480,8 @@ void door_reset()
 }
 
 // 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
index 543c1cf0bb66919b8576259587a058f8e7a2fd99..2b99cef6958634dcc1867fdc7bdf7721f2e61fb4 100644 (file)
@@ -67,18 +67,18 @@ void spawn_tdeath(vector v0, entity e, vector v)
 }
 
 .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)
index 4ce95fc396ac7c03574967877506a45986e7e1d9..c13e45137ca89f43c92b1734cc392ae79ca06d92 100644 (file)
@@ -28,81 +28,81 @@ vector real_origin(entity ent);
 .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
@@ -113,125 +113,125 @@ vector real_origin(entity ent);
 /// 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;
 
 
 /*
index e8e677ac8c1dd4a6b36c5a83d72a5b35283846fe..1a4d6c4de28b611d7fa2e8559e11ee1a8f6676b2 100644 (file)
@@ -1,8 +1,8 @@
-#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()
 {
index a91daa190194c04cc7526a8a544c6beb1f41045d..660499a5212692456446e6d75227ceb3429e8ba7 100644 (file)
@@ -1,19 +1,19 @@
-#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)
 
index 8b8d308f9dc447b653c7b38241edb80efc7ef8bd..88b2cb2a56b61d757c24fdceb686344df1063c63 100644 (file)
@@ -1,6 +1,6 @@
-#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
@@ -77,8 +77,8 @@ var float autocvar_g_vehicle_bumblebee = 0;
 
 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)
 {
index fc9cee8657f97e58af04c999e87f3d80e6358052..67e758223e5fabf3d127a81d151a260f1ada6aac 100644 (file)
@@ -1,5 +1,5 @@
-#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);
index 53e4d35f71c2e5c348ada62f5d84aa9d1389a4c8..4faf3d37ec16f3bca8517367398657b07e776c1f 100644 (file)
@@ -1,10 +1,10 @@
-#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;
index c5eb546e8b9695a505522263c0e35644d231aa71..7b579b1c5144d8eb10d8d270d2f75fb362b3e594 100644 (file)
@@ -69,11 +69,11 @@ vector autocvar_g_vehicle_spiderbot_bouncepain;
 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()
 {
index 56fc9ea009e542fd219dcf1f42cc922c4ce86e5d..9c1f0ffd8554309abd532f3c1c6c34f08ace88ba 100644 (file)
@@ -40,7 +40,7 @@ const float VHF_PLAYERSLOT    = 16384;    /// This ent is a player slot on a mul
 .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;
@@ -59,8 +59,8 @@ const float SVC_UPDATEENTITY  = 128; // Net.Protocol 0x80
 
 .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;
index 18d402a360ddf337877b009bac80547837a9021f..8b1569221563f6f024f67670b16e87816c439331 100644 (file)
@@ -3,11 +3,11 @@
 // 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);
@@ -85,16 +85,16 @@ int islessequal(float x, float y);
 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) */