]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Declare more ints as ints
authorTimePath <andrew.hardaker1995@gmail.com>
Mon, 26 Jan 2015 00:28:05 +0000 (11:28 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 26 Jan 2015 00:28:05 +0000 (11:28 +1100)
16 files changed:
qcsrc/common/command/generic.qc
qcsrc/common/command/generic.qh
qcsrc/common/command/shared_defs.qh
qcsrc/common/monsters/monsters.qc
qcsrc/common/monsters/monsters.qh
qcsrc/common/monsters/sv_monsters.qh
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/dpdefs/csprogsdefs.qc
qcsrc/dpdefs/dpextensions.qc
qcsrc/dpdefs/menudefs.qc
qcsrc/dpdefs/progsdefs.qc
qcsrc/menu/progs.src
qcsrc/menu/xonotic/playerlist.qc
qcsrc/server/defs.qh
qcsrc/server/t_items.qh

index 3c388a87399afb1ac153f50e1588334e42bef06b..d6b913a1828ee8436ad12a3cbc5acf9143ba1f2d 100644 (file)
@@ -18,7 +18,7 @@ string GetProgramCommandPrefix(void)
 }
 
 // used by curl command
-void Curl_URI_Get_Callback(float id, float status, string data)
+void Curl_URI_Get_Callback(int id, float status, string data)
 {
        int i = id - URI_GET_CURL;
        float do_exec = curl_uri_get_exec[i];
index 4f6265d154eeb24e398f3c80cbc6fc1b9f514b91..b3a63e918b7df4807aeea074e84a92635ecc6243 100644 (file)
@@ -16,7 +16,7 @@ string GetProgramCommandPrefix(void);
 #define CMD_Write_Alias(execute,command,description) CMD_Write(sprintf("alias %-20s \"%-13s %-20s ${* ?}\" // %s\n", command, execute, command, description))
 void GenericCommand_macro_write_aliases(float fh);
 
-void Curl_URI_Get_Callback(float id, float status, string data);
+void Curl_URI_Get_Callback(int id, float status, string data);
 int curl_uri_get_pos;
 float curl_uri_get_exec[URI_GET_CURL_END - URI_GET_CURL + 1];
 string curl_uri_get_cvar[URI_GET_CURL_END - URI_GET_CURL + 1];
index 9e9e6da41757dbd29732e17d5a22af25c3780878..169b0f661ea48defeb342eae47058a3f22716ec3 100644 (file)
@@ -4,5 +4,5 @@
 // =========================================================
 
 // identifiers for subfunction requests by the command code structure
-const float CMD_REQUEST_COMMAND = 1;
-const float CMD_REQUEST_USAGE = 2;
\ No newline at end of file
+const int CMD_REQUEST_COMMAND = 1;
+const int CMD_REQUEST_USAGE = 2;
\ No newline at end of file
index 1b1036f2b450c9a24bc463fbe383b2b03205e24a..54cdf4ac45a9d71a4d8ccc4692754db8fa285e25 100644 (file)
@@ -4,7 +4,7 @@
 entity monster_info[MON_MAXCOUNT];
 entity dummy_monster_info;
 
-void register_monster(int id, float(float) func, float monsterflags, vector min_s, vector max_s, string modelname, string shortname, string mname)
+void register_monster(int id, float(float) func, int monsterflags, vector min_s, vector max_s, string modelname, string shortname, string mname)
 {
        entity e;
        monster_info[id - 1] = e = spawn();
index 18d06ada4c7ee50c7ffa639cd872114699ec9741..612822e6ec7f1e1868ff8e605d6228451adb8d4c 100644 (file)
@@ -23,7 +23,7 @@ const int MON_FLAG_MELEE = 1024;
 .float(float) monster_func; // m_...
 .string mdl; // currently a copy of the model
 .string model; // full name of model
-.float spawnflags;
+.int spawnflags;
 .vector mins, maxs; // monster hitbox size
 
 // other useful macros
index 239db02bd225cb3928453f7ca4bef8f4133209e7..159ade2e32622a8a16bb57ea822b9404c219d943 100644 (file)
@@ -20,8 +20,8 @@ void monsters_setstatus(); // monsters.qc
 void monster_remove(entity mon); // removes a monster
 
 .float(float attack_type) monster_attackfunc;
-const float MONSTER_ATTACK_MELEE = 1;
-const float MONSTER_ATTACK_RANGED = 2;
+const int MONSTER_ATTACK_MELEE = 1;
+const int MONSTER_ATTACK_RANGED = 2;
 
 .float monster_skill;
 const float MONSTER_SKILL_EASY = 1;
@@ -63,26 +63,26 @@ ALLMONSTERSOUNDS
 
 float GetMonsterSoundSampleField_notFound;
 
-const float MONSTERSKILL_NOTEASY = 256; // monster will not spawn on skill <= 1
-const float MONSTERSKILL_NOTMEDIUM = 512; // monster will not spawn on skill 2
-const float MONSTERSKILL_NOTHARD = 1024; // monster will not spawn on skill >= 3
+const int MONSTERSKILL_NOTEASY = 256; // monster will not spawn on skill <= 1
+const int MONSTERSKILL_NOTMEDIUM = 512; // monster will not spawn on skill 2
+const int MONSTERSKILL_NOTHARD = 1024; // monster will not spawn on skill >= 3
 
 // new flags
-const float MONSTERFLAG_APPEAR = 2; // delay spawn until triggered
-const float MONSTERFLAG_NORESPAWN = 4;
-const float MONSTERFLAG_FLY_VERTICAL = 8; // fly/swim vertically
-const float MONSTERFLAG_INFRONT = 32; // only check for enemies infront of us
-const float MONSTERFLAG_MINIBOSS = 64; // monster spawns as mini-boss (also has a chance of naturally becoming one)
-const float MONSTERFLAG_INVINCIBLE = 128; // monster doesn't take damage (may be used for map objects & temporary monsters)
-const float MONSTERFLAG_SPAWNED = 16384; // flag for spawned monsters
-const float MONSTERFLAG_RESPAWNED = 32768; // flag for re-spawned monsters
-
-.float monster_movestate; // used to tell what the monster is currently doing
-const float MONSTER_MOVE_OWNER = 1; // monster will move to owner if in range, or stand still
-const float MONSTER_MOVE_WANDER = 2; // monster will ignore owner & wander around
-const float MONSTER_MOVE_SPAWNLOC = 3; // monster will move to its spawn location when not attacking
-const float MONSTER_MOVE_NOMOVE = 4; // monster simply stands still
-const float MONSTER_MOVE_ENEMY = 5; // used only as a movestate
-
-const float MONSTER_STATE_ATTACK_LEAP = 1;
-const float MONSTER_STATE_ATTACK_MELEE = 2;
+const int MONSTERFLAG_APPEAR = 2; // delay spawn until triggered
+const int MONSTERFLAG_NORESPAWN = 4;
+const int MONSTERFLAG_FLY_VERTICAL = 8; // fly/swim vertically
+const int MONSTERFLAG_INFRONT = 32; // only check for enemies infront of us
+const int MONSTERFLAG_MINIBOSS = 64;   // monster spawns as mini-boss (also has a chance of naturally becoming one)
+const int MONSTERFLAG_INVINCIBLE = 128; // monster doesn't take damage (may be used for map objects & temporary monsters)
+const int MONSTERFLAG_SPAWNED = 16384; // flag for spawned monsters
+const int MONSTERFLAG_RESPAWNED = 32768; // flag for re-spawned monsters
+
+.int monster_movestate; // used to tell what the monster is currently doing
+const int MONSTER_MOVE_OWNER = 1; // monster will move to owner if in range, or stand still
+const int MONSTER_MOVE_WANDER = 2; // monster will ignore owner & wander around
+const int MONSTER_MOVE_SPAWNLOC = 3; // monster will move to its spawn location when not attacking
+const int MONSTER_MOVE_NOMOVE = 4; // monster simply stands still
+const int MONSTER_MOVE_ENEMY = 5; // used only as a movestate
+
+const int MONSTER_STATE_ATTACK_LEAP = 1;
+const int MONSTER_STATE_ATTACK_MELEE = 2;
index 85d75a0c5c2e3dc3287cb1ad710c0c0a868ccaf9..5e200afeb117c8985308a27f3314695c27a1d0f3 100644 (file)
@@ -276,7 +276,7 @@ void db_save(float db, string pFilename)
        fclose(fh);
 }
 
-float db_create()
+int db_create()
 {
        return buf_create();
 }
index 0fe0ff920156afeeefc0325862581e0e5ee85298..2afe65f3735b128b128d99afd2d6070688cc5aa8 100644 (file)
@@ -82,17 +82,17 @@ vector colormapPaletteColor(float c, float isPants);
 string fstrunzone(string s);
 
 // database (NOTE: keys are case sensitive)
-void db_save(float db, string filename);
-void db_dump(float db, string pFilename);
-float db_create();
-float db_load(string filename);
-void db_close(float db);
-string db_get(float db, string key);
-void db_put(float db, string key, string value);
+void db_save(int db, string filename);
+void db_dump(int db, string pFilename);
+int db_create();
+int db_load(string filename);
+void db_close(int db);
+string db_get(int db, string key);
+void db_put(int db, string key, string value);
 
 // stringbuffer loading/saving
-float buf_load(string filename);
-void buf_save(float buf, string filename);
+int buf_load(string filename);
+void buf_save(int buf, string filename);
 
 #define TIME_TO_NTHS(t,n) floor((t) * (n) + 0.4)
 string format_time(float seconds);
index 43694accf8efdeffacbedd11efa77005b783565e..8a5031291560c85e425c7fae589e3193fc8d3def 100644 (file)
@@ -574,7 +574,7 @@ vector(entity ent, float tagindex) gettaginfo = #452;
 void(vector org, vector vel, float howmany) te_flamejet = #457;
 
 entity(float num) entitybyindex = #459;
-float() buf_create = #460;
+int() buf_create = #460;
 void(float bufhandle) buf_del = #461;
 float(float bufhandle) buf_getsize = #462;
 void(float bufhandle_from, float bufhandle_to) buf_copy = #463;
index 44b81b01f562fe6f2a25f71630b02452ce3a58f0..6696d7c3adc0f02a97c3231ca50cb3b4dcfb7606 100644 (file)
@@ -2040,35 +2040,35 @@ float trace_dphitcontents; // DPCONTENTS_ value of impacted surface (not content
 float trace_dphitq3surfaceflags; // Q3SURFACEFLAG_ value of impacted surface
 string trace_dphittexturename; // texture name of impacted surface
 //constants:
-float DPCONTENTS_SOLID = 1; // hit a bmodel, not a bounding box
-float DPCONTENTS_WATER = 2;
-float DPCONTENTS_SLIME = 4;
-float DPCONTENTS_LAVA = 8;
-float DPCONTENTS_SKY = 16;
-float DPCONTENTS_BODY = 32; // hit a bounding box, not a bmodel
-float DPCONTENTS_CORPSE = 64; // hit a SOLID_CORPSE entity
-float DPCONTENTS_NODROP = 128; // an area where backpacks should not spawn
-float DPCONTENTS_PLAYERCLIP = 256; // blocks player movement
-float DPCONTENTS_MONSTERCLIP = 512; // blocks monster movement
-float DPCONTENTS_DONOTENTER = 1024; // AI hint brush
-float DPCONTENTS_LIQUIDSMASK = 14; // WATER | SLIME | LAVA
-float DPCONTENTS_BOTCLIP = 2048; // AI hint brush
-float DPCONTENTS_OPAQUE = 4096; // only fully opaque brushes get this (may be useful for line of sight checks)
-float Q3SURFACEFLAG_NODAMAGE = 1;
-float Q3SURFACEFLAG_SLICK = 2; // low friction surface
-float Q3SURFACEFLAG_SKY = 4; // sky surface (also has NOIMPACT and NOMARKS set)
-float Q3SURFACEFLAG_LADDER = 8; // climbable surface
-float Q3SURFACEFLAG_NOIMPACT = 16; // projectiles should remove themselves on impact (this is set on sky)
-float Q3SURFACEFLAG_NOMARKS = 32; // projectiles should not leave marks, such as decals (this is set on sky)
-float Q3SURFACEFLAG_FLESH = 64; // projectiles should do a fleshy effect (blood?) on impact
-float Q3SURFACEFLAG_NODRAW = 128; // compiler hint (not important to qc)
+const int DPCONTENTS_SOLID = 1; // hit a bmodel, not a bounding box
+const int DPCONTENTS_WATER = 2;
+const int DPCONTENTS_SLIME = 4;
+const int DPCONTENTS_LAVA = 8;
+const int DPCONTENTS_SKY = 16;
+const int DPCONTENTS_BODY = 32; // hit a bounding box, not a bmodel
+const int DPCONTENTS_CORPSE = 64; // hit a SOLID_CORPSE entity
+const int DPCONTENTS_NODROP = 128; // an area where backpacks should not spawn
+const int DPCONTENTS_PLAYERCLIP = 256; // blocks player movement
+const int DPCONTENTS_MONSTERCLIP = 512; // blocks monster movement
+const int DPCONTENTS_DONOTENTER = 1024; // AI hint brush
+const int DPCONTENTS_LIQUIDSMASK = 14; // WATER | SLIME | LAVA
+const int DPCONTENTS_BOTCLIP = 2048; // AI hint brush
+const int DPCONTENTS_OPAQUE = 4096; // only fully opaque brushes get this (may be useful for line of sight checks)
+const int Q3SURFACEFLAG_NODAMAGE = 1;
+const int Q3SURFACEFLAG_SLICK = 2; // low friction surface
+const int Q3SURFACEFLAG_SKY = 4; // sky surface (also has NOIMPACT and NOMARKS set)
+const int Q3SURFACEFLAG_LADDER = 8; // climbable surface
+const int Q3SURFACEFLAG_NOIMPACT = 16; // projectiles should remove themselves on impact (this is set on sky)
+const int Q3SURFACEFLAG_NOMARKS = 32; // projectiles should not leave marks, such as decals (this is set on sky)
+const int Q3SURFACEFLAG_FLESH = 64; // projectiles should do a fleshy effect (blood?) on impact
+const int Q3SURFACEFLAG_NODRAW = 128; // compiler hint (not important to qc)
 //float Q3SURFACEFLAG_HINT = 256; // compiler hint (not important to qc)
 //float Q3SURFACEFLAG_SKIP = 512; // compiler hint (not important to qc)
 //float Q3SURFACEFLAG_NOLIGHTMAP = 1024; // compiler hint (not important to qc)
 //float Q3SURFACEFLAG_POINTLIGHT = 2048; // compiler hint (not important to qc)
-float Q3SURFACEFLAG_METALSTEPS = 4096; // walking on this surface should make metal step sounds
-float Q3SURFACEFLAG_NOSTEPS = 8192; // walking on this surface should not make footstep sounds
-float Q3SURFACEFLAG_NONSOLID = 16384; // compiler hint (not important to qc)
+const int Q3SURFACEFLAG_METALSTEPS = 4096; // walking on this surface should make metal step sounds
+const int Q3SURFACEFLAG_NOSTEPS = 8192; // walking on this surface should not make footstep sounds
+const int Q3SURFACEFLAG_NONSOLID = 16384; // compiler hint (not important to qc)
 //float Q3SURFACEFLAG_LIGHTFILTER = 32768; // compiler hint (not important to qc)
 //float Q3SURFACEFLAG_ALPHASHADOW = 65536; // compiler hint (not important to qc)
 //float Q3SURFACEFLAG_NODLIGHT = 131072; // compiler hint (not important to qc)
@@ -2459,7 +2459,7 @@ float(string s1, string s2, float len) strncasecmp = #230; // same as strcasecmp
 //idea: ??
 //darkplaces implementation: LordHavoc
 //functions to manage string buffer objects - that is, arbitrary length string arrays that are handled by the engine
-float() buf_create = #460;
+int() buf_create = #460;
 void(float bufhandle) buf_del = #461;
 float(float bufhandle) buf_getsize = #462;
 void(float bufhandle_from, float bufhandle_to) buf_copy = #463;
index 11129f50c43790e91e280c3bfe518df01650ff84..98a8003f2e5c83fa659eee1fd409c46a7414f609 100644 (file)
@@ -423,7 +423,7 @@ float CVAR_TYPEFLAG_READONLY = 32;
 //idea: ??
 //darkplaces implementation: LordHavoc
 //functions to manage string buffer objects - that is, arbitrary length string arrays that are handled by the engine
-float() buf_create = #440;
+int() buf_create = #440;
 void(float bufhandle) buf_del = #441;
 float(float bufhandle) buf_getsize = #442;
 void(float bufhandle_from, float bufhandle_to) buf_copy = #443;
index 02616873ca2c918bebb4803006cb03ca9db03fdf..bb3f106bfb854d58daadcce30de836b44ffe3b57 100644 (file)
@@ -226,167 +226,167 @@ void            end_sys_fields;                 // flag for structure dumping
 //
 
 // edict.flags
-float  FL_FLY                                  = 1;
-float  FL_SWIM                                 = 2;
-float  FL_CLIENT                               = 8;    // set for all client edicts
-float  FL_INWATER                              = 16;   // for enter / leave water splash
-float  FL_MONSTER                              = 32;
-float  FL_GODMODE                              = 64;   // player cheat
-float  FL_NOTARGET                             = 128;  // player cheat
-float  FL_ITEM                                 = 256;  // extra wide size for bonus items
-float  FL_ONGROUND                             = 512;  // standing on something
-float  FL_PARTIALGROUND                = 1024; // not all corners are valid
-float  FL_WATERJUMP                    = 2048; // player jumping out of water
-float  FL_JUMPRELEASED                 = 4096; // for jump debouncing
+const int FL_FLY                               = 1;
+const int FL_SWIM                              = 2;
+const int FL_CLIENT                            = 8;    // set for all client edicts
+const int FL_INWATER                   = 16;   // for enter / leave water splash
+const int FL_MONSTER                   = 32;
+const int FL_GODMODE                   = 64;   // player cheat
+const int FL_NOTARGET                  = 128;  // player cheat
+const int FL_ITEM                              = 256;  // extra wide size for bonus items
+const int FL_ONGROUND                  = 512;  // standing on something
+const int FL_PARTIALGROUND             = 1024; // not all corners are valid
+const int FL_WATERJUMP                 = 2048; // player jumping out of water
+const int FL_JUMPRELEASED              = 4096; // for jump debouncing
 
 // edict.movetype values
-float  MOVETYPE_NONE                   = 0;    // never moves
-//float        MOVETYPE_ANGLENOCLIP    = 1;
-//float        MOVETYPE_ANGLECLIP              = 2;
-float  MOVETYPE_WALK                   = 3;    // players only
-float  MOVETYPE_STEP                   = 4;    // discrete, not real time unless fall
-float  MOVETYPE_FLY                    = 5;
-float  MOVETYPE_TOSS                   = 6;    // gravity
-float  MOVETYPE_PUSH                   = 7;    // no clip to world, push and crush
-float  MOVETYPE_NOCLIP                 = 8;
-float  MOVETYPE_FLYMISSILE             = 9;    // fly with extra size against monsters
-float  MOVETYPE_BOUNCE                 = 10;
-float  MOVETYPE_BOUNCEMISSILE  = 11;   // bounce with extra size
+const int MOVETYPE_NONE                        = 0;    // never moves
+//const int    MOVETYPE_ANGLENOCLIP= 1;
+//const int    MOVETYPE_ANGLECLIP      = 2;
+const int MOVETYPE_WALK                        = 3;    // players only
+const int MOVETYPE_STEP                        = 4;    // discrete, not real time unless fall
+const int MOVETYPE_FLY                 = 5;
+const int MOVETYPE_TOSS                        = 6;    // gravity
+const int MOVETYPE_PUSH                        = 7;    // no clip to world, push and crush
+const int MOVETYPE_NOCLIP              = 8;
+const int MOVETYPE_FLYMISSILE  = 9;    // fly with extra size against monsters
+const int MOVETYPE_BOUNCE              = 10;
+const int MOVETYPE_BOUNCEMISSILE= 11;  // bounce with extra size
 
 // edict.solid values
-float  SOLID_NOT                               = 0;    // no interaction with other objects
-float  SOLID_TRIGGER                   = 1;    // touch on edge, but not blocking
-float  SOLID_BBOX                              = 2;    // touch on edge, block
-float  SOLID_SLIDEBOX                  = 3;    // touch on edge, but not an onground
-float  SOLID_BSP                               = 4;    // bsp clip, touch on edge, block
+const int SOLID_NOT                            = 0;    // no interaction with other objects
+const int SOLID_TRIGGER                        = 1;    // touch on edge, but not blocking
+const int SOLID_BBOX                   = 2;    // touch on edge, block
+const int SOLID_SLIDEBOX               = 3;    // touch on edge, but not an onground
+const int SOLID_BSP                            = 4;    // bsp clip, touch on edge, block
 
 // range values
-float  RANGE_MELEE                             = 0;
-float  RANGE_NEAR                              = 1;
-float  RANGE_MID                               = 2;
-float  RANGE_FAR                               = 3;
+const int RANGE_MELEE                  = 0;
+const int RANGE_NEAR                   = 1;
+const int RANGE_MID                            = 2;
+const int RANGE_FAR                            = 3;
 
 // deadflag values
 
-float  DEAD_NO                                 = 0;
-float  DEAD_DYING                              = 1;
-float  DEAD_DEAD                               = 2;
-float  DEAD_RESPAWNABLE                = 3;
-float  DEAD_RESPAWNING                 = 4; // dead, waiting for buttons to be released
+const int DEAD_NO                              = 0;
+const int DEAD_DYING                   = 1;
+const int DEAD_DEAD                            = 2;
+const int DEAD_RESPAWNABLE             = 3;
+const int DEAD_RESPAWNING              = 4; // dead, waiting for buttons to be released
 
 // takedamage values
 
-float  DAMAGE_NO                               = 0;
-float  DAMAGE_YES                              = 1;
-float  DAMAGE_AIM                              = 2;
+const int DAMAGE_NO                            = 0;
+const int DAMAGE_YES                   = 1;
+const int DAMAGE_AIM                   = 2;
 
 // items
-float  IT_AXE                                  = 4096;
-float  IT_SHOTGUN                              = 1;
-float  IT_SUPER_SHOTGUN                = 2;
-float  IT_NAILGUN                              = 4;
-float  IT_SUPER_NAILGUN                = 8;
-float  IT_GRENADE_LAUNCHER             = 16;
-float  IT_ROCKET_LAUNCHER              = 32;
-float  IT_LIGHTNING                    = 64;
-float  IT_EXTRA_WEAPON                 = 128;
-
-float  IT_SHELLS                               = 256;
-float  IT_NAILS                                = 512;
-float  IT_ROCKETS                              = 1024;
-float  IT_CELLS                                = 2048;
-
-float  IT_ARMOR1                               = 8192;
-float  IT_ARMOR2                               = 16384;
-float  IT_ARMOR3                               = 32768;
-float  IT_SUPERHEALTH                  = 65536;
-
-float  IT_KEY1                                 = 131072;
-float  IT_KEY2                                 = 262144;
-
-float  IT_INVISIBILITY                 = 524288;
-float  IT_INVULNERABILITY              = 1048576;
-float  IT_SUIT                                 = 2097152;
-float  IT_QUAD                                 = 4194304;
+const int IT_AXE                               = 4096;
+const int IT_SHOTGUN                   = 1;
+const int IT_SUPER_SHOTGUN             = 2;
+const int IT_NAILGUN                   = 4;
+const int IT_SUPER_NAILGUN             = 8;
+const int IT_GRENADE_LAUNCHER  = 16;
+const int IT_ROCKET_LAUNCHER   = 32;
+const int IT_LIGHTNING                 = 64;
+const int IT_EXTRA_WEAPON              = 128;
+
+const int IT_SHELLS                            = 256;
+const int IT_NAILS                             = 512;
+const int IT_ROCKETS                   = 1024;
+const int IT_CELLS                             = 2048;
+
+const int IT_ARMOR1                            = 8192;
+const int IT_ARMOR2                            = 16384;
+const int IT_ARMOR3                            = 32768;
+const int IT_SUPERHEALTH               = 65536;
+
+const int IT_KEY1                              = 131072;
+const int IT_KEY2                              = 262144;
+
+const int IT_INVISIBILITY              = 524288;
+const int IT_INVULNERABILITY   = 1048576;
+const int IT_SUIT                              = 2097152;
+const int IT_QUAD                              = 4194304;
 
 // point content values
 
-float  CONTENT_EMPTY                   = -1;
-float  CONTENT_SOLID                   = -2;
-float  CONTENT_WATER                   = -3;
-float  CONTENT_SLIME                   = -4;
-float  CONTENT_LAVA                    = -5;
-float  CONTENT_SKY                             = -6;
+const int CONTENT_EMPTY                        = -1;
+const int CONTENT_SOLID                        = -2;
+const int CONTENT_WATER                        = -3;
+const int CONTENT_SLIME                        = -4;
+const int CONTENT_LAVA                 = -5;
+const int CONTENT_SKY                  = -6;
 
-float  STATE_TOP               = 0;
-float  STATE_BOTTOM    = 1;
-float  STATE_UP                = 2;
-float  STATE_DOWN              = 3;
+const int STATE_TOP                            = 0;
+const int STATE_BOTTOM                 = 1;
+const int STATE_UP                             = 2;
+const int STATE_DOWN                   = 3;
 
-vector VEC_ORIGIN = '0 0 0';
-vector VEC_HULL_MIN = '-16 -16 -24';
-vector VEC_HULL_MAX = '16 16 32';
+const vector VEC_ORIGIN                = '0 0 0';
+const vector VEC_HULL_MIN              = '-16 -16 -24';
+const vector VEC_HULL_MAX              = '16 16 32';
 
-vector VEC_HULL2_MIN = '-32 -32 -24';
-vector VEC_HULL2_MAX = '32 32 64';
+const vector VEC_HULL2_MIN             = '-32 -32 -24';
+const vector VEC_HULL2_MAX             = '32 32 64';
 
 // protocol bytes
-float  SVC_TEMPENTITY          = 23;
-float  SVC_KILLEDMONSTER       = 27;
-float  SVC_FOUNDSECRET         = 28;
-float  SVC_INTERMISSION        = 30;
-float  SVC_FINALE                      = 31;
-float  SVC_CDTRACK                     = 32;
-float  SVC_SELLSCREEN          = 33;
-
-
-float  TE_SPIKE                = 0;
-float  TE_SUPERSPIKE   = 1;
-float  TE_GUNSHOT              = 2;
-float  TE_EXPLOSION    = 3;
-float  TE_TAREXPLOSION = 4;
-float  TE_LIGHTNING1   = 5;
-float  TE_LIGHTNING2   = 6;
-float  TE_WIZSPIKE             = 7;
-float  TE_KNIGHTSPIKE  = 8;
-float  TE_LIGHTNING3   = 9;
-float  TE_LAVASPLASH   = 10;
-float  TE_TELEPORT             = 11;
+const int SVC_TEMPENTITY               = 23;
+const int SVC_KILLEDMONSTER            = 27;
+const int SVC_FOUNDSECRET              = 28;
+const int SVC_INTERMISSION             = 30;
+const int SVC_FINALE                   = 31;
+const int SVC_CDTRACK                  = 32;
+const int SVC_SELLSCREEN               = 33;
+
+
+const int TE_SPIKE                             = 0;
+const int TE_SUPERSPIKE                        = 1;
+const int TE_GUNSHOT                   = 2;
+const int TE_EXPLOSION                 = 3;
+const int TE_TAREXPLOSION              = 4;
+const int TE_LIGHTNING1                        = 5;
+const int TE_LIGHTNING2                        = 6;
+const int TE_WIZSPIKE                  = 7;
+const int TE_KNIGHTSPIKE               = 8;
+const int TE_LIGHTNING3                        = 9;
+const int TE_LAVASPLASH                        = 10;
+const int TE_TELEPORT                  = 11;
 
 // sound channels
 // channel 0 never willingly overrides
 // other channels (1-7) allways override a playing sound on that channel
-float  CHAN_AUTO               = 0;
-float  CHAN_WEAPON             = 1;
-float  CHAN_VOICE              = 2;
-float  CHAN_ITEM               = 3;
-float  CHAN_BODY               = 4;
+const int CHAN_AUTO                            = 0;
+const int CHAN_WEAPON                  = 1;
+const int CHAN_VOICE                   = 2;
+const int CHAN_ITEM                            = 3;
+const int CHAN_BODY                            = 4;
 
-float  ATTN_NONE               = 0;
-float  ATTN_NORM               = 1;
-float  ATTN_IDLE               = 2;
-float  ATTN_STATIC             = 3;
+const int ATTN_NONE                            = 0;
+const int ATTN_NORM                            = 1;
+const int ATTN_IDLE                            = 2;
+const int ATTN_STATIC                  = 3;
 
 // update types
 
-float  UPDATE_GENERAL  = 0;
-float  UPDATE_STATIC   = 1;
-float  UPDATE_BINARY   = 2;
-float  UPDATE_TEMP             = 3;
+const int UPDATE_GENERAL               = 0;
+const int UPDATE_STATIC                        = 1;
+const int UPDATE_BINARY                        = 2;
+const int UPDATE_TEMP                  = 3;
 
 // entity effects
 
-float  EF_BRIGHTFIELD  = 1;
-float  EF_MUZZLEFLASH  = 2;
-float  EF_BRIGHTLIGHT  = 4;
-float  EF_DIMLIGHT     = 8;
+const int EF_BRIGHTFIELD               = 1;
+const int EF_MUZZLEFLASH               = 2;
+const int EF_BRIGHTLIGHT               = 4;
+const int EF_DIMLIGHT                  = 8;
 
 
 // messages
-float  MSG_BROADCAST   = 0;            // unreliable to all
-float  MSG_ONE                 = 1;            // reliable to one (msg_entity)
-float  MSG_ALL                 = 2;            // reliable to all
-float  MSG_INIT                = 3;            // write to the init string
+const int MSG_BROADCAST                        = 0;            // unreliable to all
+const int MSG_ONE                              = 1;            // reliable to one (msg_entity)
+const int MSG_ALL                              = 2;            // reliable to all
+const int MSG_INIT                             = 3;            // write to the init string
 
 //===========================================================================
 
index 3b1e46944449ec10a4a1f39ed6cd778a1d0ae201..8cb50679937295c6b115f63d60cdd32e17c0106e 100644 (file)
@@ -1,12 +1,12 @@
 ../../menu.dat
 
+../common/util-pre.qh
 sys-pre.qh
 ../dpdefs/menudefs.qc
 ../dpdefs/keycodes.qc
 sys-post.qh
 
 config.qh
-../common/util-pre.qh
 
 ../warpzonelib/mathlib.qh
 ../common/util.qh
index 1facda299b3ddaa58ea288723f7c0f25bebf39a4..8daf7302f7d469957763c3d6912564434172e615 100644 (file)
@@ -36,7 +36,7 @@ entity makeXonoticPlayerList()
 
 void XonoticPlayerList_setPlayerList(entity me, string plist)
 {
-       float buf,i,n;
+       int buf,i,n;
        string s;
 
        buf = buf_create();
index fb4e90038b903c0efa8de91b82462a75e9021120..de445d2e18af4d8a6d0c680581aff0204d4e94a2 100644 (file)
@@ -449,7 +449,7 @@ float round_starttime; //point in time when the countdown to round start is over
 
 void W_Porto_Remove (entity p);
 
-.float projectiledeathtype;
+.int projectiledeathtype;
 
 .string message2;
 
@@ -594,14 +594,14 @@ typedef vector(entity player, entity spot, vector current) spawn_evalfunc_t;
 string modname;
 
 .float missile_flags;
-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;
+const int MIF_SPLASH = 2;
+const int MIF_ARC = 4;
+const int MIF_PROXY = 8;
+const int MIF_GUIDED_MANUAL = 16;
+const int MIF_GUIDED_HEAT = 32;
+const int MIF_GUIDED_LASER = 64;
+const int MIF_GUIDED_AI = 128;
+const int 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 26aa170b37fb369053f93b6a4f1242bdd9d2238f..affdccbfcfc696ab771646c3450e058ecb670707 100644 (file)
@@ -1,45 +1,44 @@
 // constants
-#define WANT_CONST /* we WANT these to be constant, but it conflicts with the declaration in dpdefs/progsdefs.qc */
-const      int IT_UNLIMITED_WEAPON_AMMO        =       1; // when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.
-const      int IT_UNLIMITED_SUPERWEAPONS       =       2; // when this bit is set, superweapons don't expire. Checkpoints can give this powerup.
-const      int IT_CTF_SHIELDED                 =       4; // set for the flag shield
-const      int IT_USING_JETPACK                =       8; // confirmation that button is pressed
-const      int IT_JETPACK                      =      16; // actual item
-const      int IT_FUEL_REGEN                   =      32; // fuel regeneration trigger
+const int IT_UNLIMITED_WEAPON_AMMO             =       1; // when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.
+const int IT_UNLIMITED_SUPERWEAPONS            =       2; // when this bit is set, superweapons don't expire. Checkpoints can give this powerup.
+const int IT_CTF_SHIELDED                      =       4; // set for the flag shield
+const int IT_USING_JETPACK                     =       8; // confirmation that button is pressed
+const int IT_JETPACK                           =      16; // actual item
+const int IT_FUEL_REGEN                        =      32; // fuel regeneration trigger
 // where is 64... ?
-const      int IT_FUEL                         =     128;
-WANT_CONST int IT_SHELLS                       =     256;
-WANT_CONST int IT_NAILS                        =     512;
-WANT_CONST int IT_ROCKETS                      =    1024;
-WANT_CONST int IT_CELLS                        =    2048;
-const      int IT_SUPERWEAPON                  =    4096;
-const      int IT_STRENGTH                     =    8192;
-const      int IT_INVINCIBLE                   =   16384;
-const      int IT_HEALTH                       =   32768;
-const      int IT_PLASMA                       =   65536;
+const int IT_FUEL                                      =     128;
+const int IT_SHELLS                                    =     256;
+const int IT_NAILS                                     =     512;
+const int IT_ROCKETS                                   =    1024;
+const int IT_CELLS                                     =    2048;
+const int IT_SUPERWEAPON                               =    4096;
+const int IT_STRENGTH                                  =    8192;
+const int IT_INVINCIBLE                                =   16384;
+const int IT_HEALTH                                    =   32768;
+const int IT_PLASMA                                    =   65536;
 
 // shared value space (union):
        // for items:
-       WANT_CONST int IT_KEY1                          =  131072;
-       WANT_CONST int IT_KEY2                          =  262144;
+       const int IT_KEY1                                       =  131072;
+       const int IT_KEY2                                       =  262144;
        // for players:
-       const      int IT_RED_FLAG_TAKEN                =   32768;
-       const      int IT_RED_FLAG_LOST                 =   65536;
-       const      int IT_RED_FLAG_CARRYING             =   98304;
-       const      int IT_BLUE_FLAG_TAKEN               =  131072;
-       const      int IT_BLUE_FLAG_LOST                =  262144;
-       const      int IT_BLUE_FLAG_CARRYING            =  393216;
+       const int IT_RED_FLAG_TAKEN             =   32768;
+       const int IT_RED_FLAG_LOST              =   65536;
+       const int IT_RED_FLAG_CARRYING          =   98304;
+       const int IT_BLUE_FLAG_TAKEN            =  131072;
+       const int IT_BLUE_FLAG_LOST             =  262144;
+       const int IT_BLUE_FLAG_CARRYING         =  393216;
 // end
 
-const      int IT_5HP                          =  524288;
-const      int IT_25HP                         = 1048576;
-const      int IT_ARMOR_SHARD                  = 2097152;
-const      int IT_ARMOR                        = 4194304;
+const int IT_5HP                               =  524288;
+const int IT_25HP                              = 1048576;
+const int IT_ARMOR_SHARD                       = 2097152;
+const int IT_ARMOR                             = 4194304;
 
 // item masks
-const      int IT_AMMO                         =    3968; // IT_FUEL | IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | IT_PLASMA;
-const      int IT_PICKUPMASK                   =      51; // IT_FUEL_REGEN | IT_JETPACK | IT_UNLIMITED_AMMO; // strength and invincible are handled separately
-const      int IT_UNLIMITED_AMMO               =       3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;
+const int IT_AMMO                              =    3968; // IT_FUEL | IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | IT_PLASMA;
+const int IT_PICKUPMASK                        =      51; // IT_FUEL_REGEN | IT_JETPACK | IT_UNLIMITED_AMMO; // strength and invincible are handled separately
+const int IT_UNLIMITED_AMMO                    =       3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;
 
 const int AMMO_COUNT = 4; // amount of ammo types to show in the inventory panel