]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Label some field pointers with the const attribute
authorterencehill <piuntn@gmail.com>
Tue, 29 Jan 2019 21:12:20 +0000 (22:12 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 29 Jan 2019 21:12:20 +0000 (22:12 +0100)
qcsrc/common/items/item.qh
qcsrc/common/items/item/ammo.qh
qcsrc/common/vehicles/sv_vehicles.qh
qcsrc/server/defs.qh

index 030b4db1c089f53f06c62a1cb19590ac48b50977..cf4e288ba6cd1769c127ef9ca27ab16ca8411579 100644 (file)
@@ -48,8 +48,8 @@ const int IT_UNLIMITED_AMMO                   = IT_UNLIMITED_WEAPON_AMMO | IT_UNLIMITE
 const int IT_PICKUPMASK                        = IT_UNLIMITED_AMMO | IT_JETPACK | IT_FUEL_REGEN; // strength and invincible are handled separately
 
 #ifdef SVQC
-.float  strength_finished = _STAT(STRENGTH_FINISHED);
-.float  invincible_finished = _STAT(INVINCIBLE_FINISHED);
+const .float strength_finished = _STAT(STRENGTH_FINISHED);
+const .float invincible_finished = _STAT(INVINCIBLE_FINISHED);
 
 #define spawnfunc_body(item) \
        if (!Item_IsDefinitionAllowed(item)) \
index 3249f07bca6caf6be0d76ae1b49ad4542c255c4c..51480b453644e28ac2c5d2d427dedc52506a09e6 100644 (file)
@@ -14,8 +14,8 @@
 .int ammo_rockets;
 .int ammo_cells;
 #ifdef SVQC
-.int ammo_plasma = _STAT(PLASMA);
-.int ammo_fuel = _STAT(FUEL);
+const .int ammo_plasma = _STAT(PLASMA);
+const .int ammo_fuel = _STAT(FUEL);
 #else
 .int ammo_plasma;
 .int ammo_fuel;
index a1f23c1dfcc1b95522a3300296737dc4a927b026..6c2074f4a7d901aaa97a16513d38916a385e623a 100644 (file)
@@ -45,14 +45,14 @@ float autocvar_g_vehicles_weapon_damagerate = 2;
 .entity gunner1;
 .entity gunner2;
 
-.float vehicle_health = _STAT(VEHICLESTAT_HEALTH);  /// If ent is player this is 0..100 indicating precentage of health left on vehicle. Vehicle's value is the health resource
-.float vehicle_energy = _STAT(VEHICLESTAT_ENERGY);  /// If ent is player this is 0..100 indicating precentage of energy left on vehicle. If ent is vehicle, this is the real energy value.
-.float vehicle_shield = _STAT(VEHICLESTAT_SHIELD);  /// If ent is player this is 0..100 indicating precentage of shield left on vehicle. If ent is vehicle, this is the real shield value.
-
-.float vehicle_ammo1 = _STAT(VEHICLESTAT_AMMO1);   /// If ent is player this is 0..100 indicating percentage of primary ammo left UNLESS value is already stored in vehicle_energy. If ent is vehicle, this is the real ammo1 value.
-.float vehicle_reload1 = _STAT(VEHICLESTAT_RELOAD1); /// If ent is player this is 0..100 indicating percentage of primary reload status. If ent is vehicle, this is the real reload1 value.
-.float vehicle_ammo2 = _STAT(VEHICLESTAT_AMMO2);   /// If ent is player this is 0..100 indicating percentage of secondary ammo left. If ent is vehicle, this is the real ammo2 value.
-.float vehicle_reload2 = _STAT(VEHICLESTAT_RELOAD2); /// If ent is player this is 0..100 indicating percentage of secondary reload status. If ent is vehicle, this is the real reload2 value.
+const .float vehicle_health = _STAT(VEHICLESTAT_HEALTH);  /// If ent is player this is 0..100 indicating precentage of health left on vehicle. Vehicle's value is the health resource
+const .float vehicle_energy = _STAT(VEHICLESTAT_ENERGY);  /// If ent is player this is 0..100 indicating precentage of energy left on vehicle. If ent is vehicle, this is the real energy value.
+const .float vehicle_shield = _STAT(VEHICLESTAT_SHIELD);  /// If ent is player this is 0..100 indicating precentage of shield left on vehicle. If ent is vehicle, this is the real shield value.
+
+const .float vehicle_ammo1 = _STAT(VEHICLESTAT_AMMO1);   /// If ent is player this is 0..100 indicating percentage of primary ammo left UNLESS value is already stored in vehicle_energy. If ent is vehicle, this is the real ammo1 value.
+const .float vehicle_reload1 = _STAT(VEHICLESTAT_RELOAD1); /// If ent is player this is 0..100 indicating percentage of primary reload status. If ent is vehicle, this is the real reload1 value.
+const .float vehicle_ammo2 = _STAT(VEHICLESTAT_AMMO2);   /// If ent is player this is 0..100 indicating percentage of secondary ammo left. If ent is vehicle, this is the real ammo2 value.
+const .float vehicle_reload2 = _STAT(VEHICLESTAT_RELOAD2); /// If ent is player this is 0..100 indicating percentage of secondary reload status. If ent is vehicle, this is the real reload2 value.
 
 .float sound_nexttime;
 const float VOL_VEHICLEENGINE = 1;
index 5b5d8a66b78a017e5f077e975592e94b0b65227d..c66ad28fe3e190a1b3582cb2e227b6d3ca025d4a 100644 (file)
@@ -50,7 +50,7 @@ float server_is_dedicated;
 .float pain_frame;                     //"
 .float  crouch;        // Crouching or not?
 
-.float superweapons_finished = _STAT(SUPERWEAPONS_FINISHED);
+const .float superweapons_finished = _STAT(SUPERWEAPONS_FINISHED);
 
 .float cnt; // used in too many places
 .float count;