From db34cb152d5a7299366996a886f1f204ae1a28a3 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 13 Jul 2015 12:40:42 +1000 Subject: [PATCH] Boolinterize --- qcsrc/common/vehicles/cl_vehicles.qc | 33 ++++++++++++------------- qcsrc/common/vehicles/sv_vehicles.qc | 30 +++++++++++----------- qcsrc/common/vehicles/unit/bumblebee.qh | 4 ++- qcsrc/common/vehicles/unit/raptor.qc | 2 +- 4 files changed, 35 insertions(+), 34 deletions(-) diff --git a/qcsrc/common/vehicles/cl_vehicles.qc b/qcsrc/common/vehicles/cl_vehicles.qc index 8c4bd6044..4edaff91b 100644 --- a/qcsrc/common/vehicles/cl_vehicles.qc +++ b/qcsrc/common/vehicles/cl_vehicles.qc @@ -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) diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index be0a1deae..58d2dd47c 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -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; diff --git a/qcsrc/common/vehicles/unit/bumblebee.qh b/qcsrc/common/vehicles/unit/bumblebee.qh index 2373e9869..7c387e448 100644 --- a/qcsrc/common/vehicles/unit/bumblebee.qh +++ b/qcsrc/common/vehicles/unit/bumblebee.qh @@ -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 diff --git a/qcsrc/common/vehicles/unit/raptor.qc b/qcsrc/common/vehicles/unit/raptor.qc index b8cf0d2a5..137bdccab 100644 --- a/qcsrc/common/vehicles/unit/raptor.qc +++ b/qcsrc/common/vehicles/unit/raptor.qc @@ -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) -- 2.39.2