]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Boolinterize
authorMario <zacjardine@y7mail.com>
Mon, 13 Jul 2015 02:40:42 +0000 (12:40 +1000)
committerMario <zacjardine@y7mail.com>
Mon, 13 Jul 2015 02:40:42 +0000 (12:40 +1000)
qcsrc/common/vehicles/cl_vehicles.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/unit/bumblebee.qh
qcsrc/common/vehicles/unit/raptor.qc

index 8c4bd6044bfa7209befd6861e0d60cdaa60d2753..4edaff91b327d1940d77d628c6b44449c066647d 100644 (file)
@@ -1,33 +1,33 @@
-#define hud_bg "gfx/vehicles/frame.tga"
-#define hud_sh "gfx/vehicles/vh-shield.tga"
+const string hud_bg = "gfx/vehicles/frame.tga";
+const string hud_sh = "gfx/vehicles/vh-shield.tga";
 
-#define hud_hp_bar "gfx/vehicles/bar_up_left.tga"
-#define hud_hp_ico "gfx/vehicles/health.tga"
-#define hud_sh_bar "gfx/vehicles/bar_dwn_left.tga"
-#define hud_sh_ico "gfx/vehicles/shield.tga"
+const string hud_hp_bar = "gfx/vehicles/bar_up_left.tga";
+const string hud_hp_ico = "gfx/vehicles/health.tga";
+const string hud_sh_bar = "gfx/vehicles/bar_dwn_left.tga";
+const string hud_sh_ico = "gfx/vehicles/shield.tga";
 
-#define hud_ammo1_bar "gfx/vehicles/bar_up_right.tga"
-#define hud_ammo1_ico "gfx/vehicles/bullets.tga"
-#define hud_ammo2_bar "gfx/vehicles/bar_dwn_right.tga"
-#define hud_ammo2_ico "gfx/vehicles/rocket.tga"
-#define hud_energy "gfx/vehicles/energy.tga"
+const string hud_ammo1_bar = "gfx/vehicles/bar_up_right.tga";
+const string hud_ammo1_ico = "gfx/vehicles/bullets.tga";
+const string hud_ammo2_bar = "gfx/vehicles/bar_dwn_right.tga";
+const string hud_ammo2_ico = "gfx/vehicles/rocket.tga";
+const string hud_energy = "gfx/vehicles/energy.tga";
 
 entity dropmark;
 float autocvar_cl_vehicles_hudscale = 0.5;
 float autocvar_cl_vehicles_hudalpha = 0.75;
 
-const float MAX_AXH = 4;
+const int MAX_AXH = 4;
 entity AuxiliaryXhair[MAX_AXH];
 
 .string axh_image;
 .float  axh_fadetime;
-.float  axh_drawflag;
+.int    axh_drawflag;
 .float  axh_scale;
 
 float alarm1time;
 float alarm2time;
 
-void vehicle_alarm(entity e, float ch, string s0und)
+void vehicle_alarm(entity e, int ch, string s0und)
 {
        if(!autocvar_cl_vehicles_alarm)
                return;
@@ -82,9 +82,8 @@ void Net_AuXair2(bool bIsNew)
 
 void Net_VehicleSetup()
 {
-       float i;
-
-       float hud_id = ReadByte();
+       int i;
+       int hud_id = ReadByte();
 
        // hud_id == 0 means we exited a vehicle, so stop alarm sound/s
        if(hud_id == 0)
index be0a1deaeeb8f5bffd752a6e7c8618d485122f61..58d2dd47cdbdbf9275e549e689f3fcb710c7888c 100644 (file)
@@ -19,7 +19,7 @@ float SendAuxiliaryXhair(entity to, float sf)
        return true;
 }
 
-void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, float axh_id)
+void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, int axh_id)
 {
        if(!IS_REAL_CLIENT(own))
                return;
@@ -44,7 +44,7 @@ void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, float axh_id)
        own.(AuxiliaryXhair[axh_id]) = axh;
 }
 
-void CSQCVehicleSetup(entity own, float vehicle_id)
+void CSQCVehicleSetup(entity own, int vehicle_id)
 {
        if(!IS_REAL_CLIENT(own))
                return;
@@ -59,7 +59,7 @@ void CSQCVehicleSetup(entity own, float vehicle_id)
 vector targetdrone_getnewspot()
 {
        vector spot;
-       float i;
+       int i;
        for(i = 0; i < 100; ++i)
        {
                spot = self.origin + randomvec() * 1024;
@@ -176,7 +176,7 @@ vector vehicles_force_fromtag_maglev(string tag_name, float spring_length, float
 }
 
 // projectile handling
-void vehicles_projectile_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void vehicles_projectile_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {
        // Ignore damage from oterh projectiles from my owner (dont mess up volly's)
        if(inflictor.owner == self.owner)
@@ -215,8 +215,8 @@ void vehicles_projectile_explode()
 entity vehicles_projectile(string _mzlfx, string _mzlsound,
                                                   vector _org, vector _vel,
                                                   float _dmg, float _radi, float _force,  float _size,
-                                                  float _deahtype, float _projtype, float _health,
-                                                  float _cull, float _clianim, entity _owner)
+                                                  int _deahtype, float _projtype, float _health,
+                                                  bool _cull, bool _clianim, entity _owner)
 {
        entity proj;
 
@@ -282,7 +282,7 @@ void vehicles_gib_think()
                self.nextthink = time + 0.1;
 }
 
-entity vehicle_tossgib(entity _template, vector _vel, string _tag, float _burn, float _explode, float _maxtime, vector _rot)
+entity vehicle_tossgib(entity _template, vector _vel, string _tag, bool _burn, bool _explode, float _maxtime, vector _rot)
 {
        entity _gib = spawn();
        setmodel(_gib, _template.model);
@@ -313,12 +313,12 @@ entity vehicle_tossgib(entity _template, vector _vel, string _tag, float _burn,
        return _gib;
 }
 
-float vehicle_addplayerslot(   entity _owner,
+bool vehicle_addplayerslot(    entity _owner,
                                                                entity _slot,
-                                                               float _hud,
+                                                               int _hud,
                                                                string _hud_model,
-                                                               float() _framefunc,
-                                                               void(float) _exitfunc, float() _enterfunc)
+                                                               bool() _framefunc,
+                                                               void(bool) _exitfunc, float() _enterfunc)
 {
        if(!(_owner.vehicle_flags & VHF_MULTISLOT))
                _owner.vehicle_flags |= VHF_MULTISLOT;
@@ -612,7 +612,7 @@ void vehicles_painframe()
        }
 }
 
-void vehicles_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void vehicles_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {
        self.dmg_time = time;
 
@@ -787,7 +787,7 @@ vector vehicles_findgoodexit(vector prefer_spot)
        return self.origin;
 }
 
-void vehicles_exit(float eject)
+void vehicles_exit(bool eject)
 {
        entity _vehicle;
        entity _player;
@@ -980,7 +980,7 @@ void vehicles_enter(entity pl, entity veh)
                if(autocvar_g_vehicles_steal_show_waypoint)
                        WaypointSprite_Spawn("intruder", 0, 0, pl, '0 0 68', world, veh.team, veh, wps_intruder, true, RADARICON_DANGER, Team_ColorRGB(pl.team));
        }
-       else { return; }
+       else return;
 
        RemoveGrapplingHook(pl);
 
@@ -1138,7 +1138,7 @@ void vehicles_spawn()
        CSQCMODEL_AUTOINIT();
 }
 
-float vehicle_initialize(float vehicle_id, float nodrop)
+bool vehicle_initialize(int vehicle_id, bool nodrop)
 {
        if(!autocvar_g_vehicles)
                return false;
index 2373e9869eddeb87bde39f982fd6a96ba94b4aee..7c387e44864993070eaf89768d70d48027825112 100644 (file)
@@ -1,8 +1,10 @@
 #ifndef BUMBLEBEE_H
 #define BUMBLEBEE_H
 
+#ifdef CSQC
 void bumble_raygun_read(bool bIsNew);
 
 void CSQC_BUMBLE_GUN_HUD();
+#endif
 
-#endif
\ No newline at end of file
+#endif
index b8cf0d2a558b1a6cde12ccce596a01487f536e9b..137bdccabfee0f965dcce6156b6bf05517efd288 100644 (file)
@@ -275,7 +275,7 @@ void raptor_flare_touch()
        remove(self);
 }
 
-void raptor_flare_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void raptor_flare_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {
        self.health -= damage;
        if(self.health <= 0)