]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Vehicles: remove VEH_ACTION
authorTimePath <andrew.hardaker1995@gmail.com>
Thu, 1 Oct 2015 07:40:19 +0000 (17:40 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Thu, 1 Oct 2015 07:40:19 +0000 (17:40 +1000)
qcsrc/client/view.qc
qcsrc/common/vehicles/all.qh
qcsrc/common/vehicles/cl_vehicles.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/vehicle.qh
qcsrc/common/vehicles/vehicle/bumblebee.qc
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/common/vehicles/vehicle/raptor.qc
qcsrc/common/vehicles/vehicle/spiderbot.qc

index f220e2affc8dcb596aba669c93a463ff3f9ee930..dfb1ef5afec13c3e18f3a4928f484f8b118cb16c 100644 (file)
@@ -1860,8 +1860,10 @@ void CSQC_UpdateView(float w, float h)
     if(hud && !intermission)
     if(hud == HUD_BUMBLEBEE_GUN)
        CSQC_BUMBLE_GUN_HUD();
-    else
-               VEH_ACTION(hud, VR_HUD);
+    else {
+       Vehicle info = get_vehicleinfo(hud);
+               info.vr_hud(info);
+       }
 
        cl_notice_run();
 
index cf4a034ebf7894ebb167820ffcc6a2e9b1409d2f..14c84f3a806b752b7e0e4b096e8ad579df622b3c 100644 (file)
@@ -6,6 +6,7 @@
 void RegisterVehicles();
 const int VEH_MAXCOUNT = 24;
 entity vehicle_info[VEH_MAXCOUNT], vehicle_info_first, vehicle_info_last;
+Vehicle get_vehicleinfo(int id);
 int VEH_COUNT;
 const int VEH_FIRST = 1;
 #define VEH_LAST (VEH_FIRST + VEH_COUNT - 1)
index a91e3e212abcac3e162aeb2d901200297003e7f3..338b015d6797adfa8e899b54b9ad972ea1edef05 100644 (file)
@@ -106,8 +106,10 @@ void Net_VehicleSetup()
        {
                AuxiliaryXhair[0].axh_image = vCROSS_BURST; // Plasma cannons
                AuxiliaryXhair[1].axh_image = vCROSS_BURST; // Raygun
+       } else {
+               Vehicle info = get_vehicleinfo(hud_id);
+       info.vr_setup(info);
        }
-       else { VEH_ACTION(hud_id, VR_SETUP); }
 }
 
 void Vehicles_drawHUD(
index 8f2f7581a215c4c8cb2264dffecfd9cfe355589f..b09cff476b6ef522b6c0ea8604d1a7d6f92f1851 100644 (file)
@@ -737,7 +737,8 @@ void vehicles_damage(entity inflictor, entity attacker, float damage, int deatht
 
                antilag_clear(self);
 
-               VEH_ACTION(self.vehicleid, VR_DEATH);
+               Vehicle info = get_vehicleinfo(self.vehicleid);
+               info.vr_death(info);
                vehicles_setreturn(self);
        }
 }
@@ -942,8 +943,10 @@ void vehicles_touch()
                        return; // Dont do selfdamage when hitting "soft targets".
                }
 
-               if(self.play_time < time)
-                       VEH_ACTION(self.vehicleid, VR_IMPACT);
+               if(self.play_time < time) {
+                       Vehicle info = get_vehicleinfo(self.vehicleid);
+                       info.vr_impact(info);
+               }
 
                return;
        }
@@ -1113,7 +1116,8 @@ void vehicles_enter(entity pl, entity veh)
 
        setself(veh);
        CSQCModel_UnlinkEntity();
-       VEH_ACTION(veh.vehicleid, VR_ENTER);
+       Vehicle info = get_vehicleinfo(veh.vehicleid);
+       info.vr_enter(info);
        setself(this);
 
        antilag_clear(pl);
@@ -1126,7 +1130,8 @@ void vehicles_think()
        if(self.owner)
                self.owner.vehicle_weapon2mode = self.vehicle_weapon2mode;
 
-       VEH_ACTION(self.vehicleid, VR_THINK);
+       Vehicle info = get_vehicleinfo(self.vehicleid);
+       info.vr_think(info);
 
        CSQCMODEL_AUTOUPDATE(self);
 }
@@ -1177,7 +1182,8 @@ void vehicles_spawn()
 
        vehicles_reset_colors();
 
-       VEH_ACTION(self.vehicleid, VR_SPAWN);
+       Vehicle info = get_vehicleinfo(self.vehicleid);
+       info.vr_spawn(info);
 
        CSQCMODEL_AUTOINIT(self);
 }
@@ -1190,7 +1196,10 @@ bool vehicle_initialize(entity veh, bool nodrop)
        if(!veh.vehicleid)
                return false;
 
-       if(!veh.tur_head) { VEH_ACTION(veh.vehicleid, VR_PRECACHE); }
+       if(!veh.tur_head) {
+               Vehicle info = get_vehicleinfo(veh.vehicleid);
+               info.vr_precache(info);
+       }
 
        if(self.targetname && self.targetname != "")
        {
@@ -1283,7 +1292,8 @@ bool vehicle_initialize(entity veh, bool nodrop)
        self.pos2 = self.angles;
        self.tur_head.team = self.team;
 
-       VEH_ACTION(veh.vehicleid, VR_SETUP);
+       Vehicle info = get_vehicleinfo(veh.vehicleid);
+       info.vr_setup(info);
 
        if(self.active == ACTIVE_NOT)
                self.nextthink = 0; // wait until activated
index 3dc72896331a7cf786634e3ceb21765e2bbfdc20..80787b4ae619eb8acda9abb09e101c698be384d3 100644 (file)
@@ -1,53 +1,6 @@
 #ifndef VEHICLE_H
 #define VEHICLE_H
 
-// vehicle requests
-const int VR_SETUP          = 1; // (BOTH) setup vehicle data
-.bool(entity) vr_setup;
-const int VR_THINK                     = 2; // (SERVER) logic to run every frame
-.bool(entity) vr_think;
-const int VR_DEATH          = 3; // (SERVER) called when vehicle dies
-.bool(entity) vr_death;
-const int VR_PRECACHE       = 4; // (BOTH) precaches models/sounds used by this vehicle
-.bool(entity) vr_precache;
-const int VR_ENTER          = 5; // (SERVER) called when a player enters this vehicle
-.bool(entity) vr_enter;
-const int VR_SPAWN          = 6; // (SERVER) called when the vehicle re-spawns
-.bool(entity) vr_spawn;
-const int VR_IMPACT         = 7; // (SERVER) called when a vehicle hits something
-.bool(entity) vr_impact;
-const int VR_HUD            = 8; // (CLIENT) logic to run every frame
-.bool(entity) vr_hud;
-
-// vehicle spawn flags (need them here for common registrations)
-const int VHF_ISVEHICLE                        = 2; /// Indicates vehicle
-const int VHF_HASSHIELD                        = 4; /// Vehicle has shileding
-const int VHF_SHIELDREGEN              = 8; /// Vehicles shield regenerates
-const int VHF_HEALTHREGEN              = 16; /// Vehicles health regenerates
-const int VHF_ENERGYREGEN              = 32; /// Vehicles energy regenerates
-const int VHF_DEATHEJECT               = 64; /// Vehicle ejects pilot upon fatal damage
-const int VHF_MOVE_GROUND              = 128; /// Vehicle moves on gound
-const int VHF_MOVE_HOVER               = 256; /// Vehicle hover close to gound
-const int VHF_MOVE_FLY                 = 512; /// Vehicle is airborn
-const int VHF_DMGSHAKE                 = 1024; /// Add random velocity each frame if health < 50%
-const int VHF_DMGROLL                  = 2048; /// Add random angles each frame if health < 50%
-const int VHF_DMGHEADROLL              = 4096; /// Add random head angles each frame if health < 50%
-const int VHF_MULTISLOT                        = 8192; /// Vehicle has multiple player slots
-const int VHF_PLAYERSLOT               = 16384; /// This ent is a player slot on a multi-person vehicle
-
-// functions:
-entity get_vehicleinfo(int id);
-
-// fields:
-.entity tur_head;
-
-// other useful macros
-#define _VEH_ACTION(veh, mrequest) veh.vehicle_func(veh, mrequest)
-#define VEH_ACTION(veh, mrequest) _VEH_ACTION(get_vehicleinfo(veh), mrequest)
-#define VEH_NAME(veh) (get_vehicleinfo(veh)).vehicle_name
-
-bool v_new(entity, int);
-
 CLASS(Vehicle, Object)
     ATTRIB(Vehicle, vehicleid, int, 0)
     /** hud icon */
@@ -56,8 +9,6 @@ CLASS(Vehicle, Object)
     ATTRIB(Vehicle, netname, string, "")
     /** human readable name */
     ATTRIB(Vehicle, vehicle_name, string, "Vehicle")
-    /**  */
-    ATTRIB(Vehicle, vehicle_func, bool(Vehicle, int), v_new)
     /** full name of model */
     ATTRIB(Vehicle, model, string, "")
     /** currently a copy of the model */
@@ -80,19 +31,42 @@ CLASS(Vehicle, Object)
     ATTRIB(Vehicle, mins, vector, '-0 -0 -0')
     /** vehicle hitbox size */
     ATTRIB(Vehicle, maxs, vector, '0 0 0')
+
+    /** (BOTH) setup vehicle data */
+    METHOD(Vehicle, vr_setup, void(Vehicle)) { }
+    /** (SERVER) logic to run every frame */
+    METHOD(Vehicle, vr_think, void(Vehicle)) { }
+    /** (SERVER) called when vehicle dies */
+    METHOD(Vehicle, vr_death, void(Vehicle)) { }
+    /** (BOTH) precaches models/sounds used by this vehicle */
+    METHOD(Vehicle, vr_precache, void(Vehicle)) { }
+    /** (SERVER) called when a player enters this vehicle */
+    METHOD(Vehicle, vr_enter, void(Vehicle)) { }
+    /** (SERVER) called when the vehicle re-spawns */
+    METHOD(Vehicle, vr_spawn, void(Vehicle)) { }
+    /** (SERVER) called when a vehicle hits something */
+    METHOD(Vehicle, vr_impact, void(Vehicle)) { }
+    /** (CLIENT) logic to run every frame */
+    METHOD(Vehicle, vr_hud, void(Vehicle)) { }
 ENDCLASS(Vehicle)
 
-bool v_new(Vehicle this, int req)
-{
-    if (req == VR_SETUP) return this.vr_setup ? this.vr_setup(this) : false;
-    if (req == VR_THINK) return this.vr_think ? this.vr_think(this) : false;
-    if (req == VR_DEATH) return this.vr_death ? this.vr_death(this) : false;
-    if (req == VR_PRECACHE) return this.vr_precache ? this.vr_precache(this) : false;
-    if (req == VR_ENTER) return this.vr_enter ? this.vr_enter(this) : false;
-    if (req == VR_SPAWN) return this.vr_spawn ? this.vr_spawn(this) : false;
-    if (req == VR_IMPACT) return this.vr_impact ? this.vr_impact(this) : false;
-    if (req == VR_HUD) return this.vr_hud ? this.vr_hud(this) : false;
-    return false;
-}
+// vehicle spawn flags (need them here for common registrations)
+const int VHF_ISVEHICLE                        = 2; /// Indicates vehicle
+const int VHF_HASSHIELD                        = 4; /// Vehicle has shileding
+const int VHF_SHIELDREGEN              = 8; /// Vehicles shield regenerates
+const int VHF_HEALTHREGEN              = 16; /// Vehicles health regenerates
+const int VHF_ENERGYREGEN              = 32; /// Vehicles energy regenerates
+const int VHF_DEATHEJECT               = 64; /// Vehicle ejects pilot upon fatal damage
+const int VHF_MOVE_GROUND              = 128; /// Vehicle moves on gound
+const int VHF_MOVE_HOVER               = 256; /// Vehicle hover close to gound
+const int VHF_MOVE_FLY                 = 512; /// Vehicle is airborn
+const int VHF_DMGSHAKE                 = 1024; /// Add random velocity each frame if health < 50%
+const int VHF_DMGROLL                  = 2048; /// Add random angles each frame if health < 50%
+const int VHF_DMGHEADROLL              = 4096; /// Add random head angles each frame if health < 50%
+const int VHF_MULTISLOT                        = 8192; /// Vehicle has multiple player slots
+const int VHF_PLAYERSLOT               = 16384; /// This ent is a player slot on a multi-person vehicle
+
+// fields:
+.entity tur_head;
 
 #endif
index 7176142133ca0d6da065ccf97d427c9cb12ff4f0..65aa61937e07bebc21dee8dd86dea5eda5aeca95 100644 (file)
@@ -729,22 +729,19 @@ void spawnfunc_vehicle_bumblebee()
        if(!vehicle_initialize(VEH_BUMBLEBEE, false)) { remove(self); return; }
 }
 
-               METHOD(Bumblebee, vr_impact, bool(Bumblebee thisveh))
+               METHOD(Bumblebee, vr_impact, void(Bumblebee thisveh))
                {
                        if(autocvar_g_vehicle_bumblebee_bouncepain)
                                vehicles_impact(autocvar_g_vehicle_bumblebee_bouncepain_x, autocvar_g_vehicle_bumblebee_bouncepain_y, autocvar_g_vehicle_bumblebee_bouncepain_z);
-
-                       return true;
                }
-               METHOD(Bumblebee, vr_enter, bool(Bumblebee thisveh))
+               METHOD(Bumblebee, vr_enter, void(Bumblebee thisveh))
                {
                        SELFPARAM();
                        self.touch = bumblebee_touch;
                        self.nextthink = 0;
                        self.movetype = MOVETYPE_BOUNCEMISSILE;
-                       return true;
                }
-               METHOD(Bumblebee, vr_think, bool(Bumblebee thisveh))
+               METHOD(Bumblebee, vr_think, void(Bumblebee thisveh))
                {
                        SELFPARAM();
                        self.angles_z *= 0.8;
@@ -765,7 +762,7 @@ void spawnfunc_vehicle_bumblebee()
                                        self.phase = 0;
                                        self.touch();
                                        other = oldother;
-                                       return true;
+                                       return;
                                }
 
                                if(self.gunner2)
@@ -778,13 +775,11 @@ void spawnfunc_vehicle_bumblebee()
                                        self.phase = 0;
                                        self.touch();
                                        other = oldother;
-                                       return true;
+                                       return;
                                }
                        }
-
-                       return true;
                }
-               METHOD(Bumblebee, vr_death, bool(Bumblebee thisveh))
+               METHOD(Bumblebee, vr_death, void(Bumblebee thisveh))
                {
                        SELFPARAM();
                        entity oldself = self;
@@ -847,9 +842,8 @@ void spawnfunc_vehicle_bumblebee()
                        self.nextthink          = 0;
 
                        setorigin(self, self.pos1);
-                       return true;
                }
-               METHOD(Bumblebee, vr_spawn, bool(Bumblebee thisveh))
+               METHOD(Bumblebee, vr_spawn, void(Bumblebee thisveh))
                {
                        SELFPARAM();
                        if(!self.gun1)
@@ -928,9 +922,8 @@ void spawnfunc_vehicle_bumblebee()
                        self.PlayerPhysplug = bumblebee_pilot_frame;
 
                        setorigin(self, self.origin + '0 0 25');
-                       return true;
                }
-               METHOD(Bumblebee, vr_setup, bool(Bumblebee thisveh))
+               METHOD(Bumblebee, vr_setup, void(Bumblebee thisveh))
                {
                        SELFPARAM();
                        if(autocvar_g_vehicle_bumblebee_energy)
@@ -951,12 +944,6 @@ void spawnfunc_vehicle_bumblebee()
                        self.vehicle_health = autocvar_g_vehicle_bumblebee_health;
                        self.max_health = self.vehicle_health;
                        self.vehicle_shield = autocvar_g_vehicle_bumblebee_shield;
-
-                       return true;
-               }
-               METHOD(Bumblebee, vr_precache, bool(Bumblebee thisveh))
-               {
-                       return true;
                }
 
 #endif // SVQC
@@ -970,24 +957,18 @@ void CSQC_BUMBLE_GUN_HUD()
                                         string_null);
 }
 
-               METHOD(Bumblebee, vr_hud, bool(Bumblebee thisveh))
+               METHOD(Bumblebee, vr_hud, void(Bumblebee thisveh))
                {
                        Vehicles_drawHUD(VEH_BUMBLEBEE.m_icon, "vehicle_bumble_weapon1", "vehicle_bumble_weapon2",
                                                         "vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
                                                         "vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
                                                         vCROSS_HEAL);
-                       return true;
                }
-               METHOD(Bumblebee, vr_setup, bool(Bumblebee thisveh))
+               METHOD(Bumblebee, vr_setup, void(Bumblebee thisveh))
                {
                        AuxiliaryXhair[0].axh_image = vCROSS_LOCK;  // Raygun-locked
                        AuxiliaryXhair[1].axh_image = vCROSS_BURST; // Gunner1
                        AuxiliaryXhair[2].axh_image = vCROSS_BURST; // Gunner2
-                       return true;
-               }
-               METHOD(Bumblebee, vr_precache, bool(Bumblebee thisveh))
-               {
-                       return true;
                }
 
 #endif
index da10b87d005d4b14bdfb24a8af62b86d59e247dc..98c84c2102103e1b3d913fe079291d94d3d1447f 100644 (file)
@@ -557,16 +557,15 @@ void racer_draw()
 #endif
 #endif
 
-               METHOD(Racer, vr_impact, bool(Racer thisveh))
+               METHOD(Racer, vr_impact, void(Racer thisveh))
                {
                #ifdef SVQC
                        if(autocvar_g_vehicle_racer_bouncepain)
                                vehicles_impact(autocvar_g_vehicle_racer_bouncepain_x, autocvar_g_vehicle_racer_bouncepain_y, autocvar_g_vehicle_racer_bouncepain_z);
                #endif
-                       return true;
                }
 
-               METHOD(Racer, vr_enter, bool(Racer thisveh))
+               METHOD(Racer, vr_enter, void(Racer thisveh))
                {
                #ifdef SVQC
                        self.movetype = MOVETYPE_BOUNCE;
@@ -579,11 +578,9 @@ void racer_draw()
 
                        self.move_movetype = MOVETYPE_BOUNCE;
                #endif
-
-                       return true;
                }
 
-               METHOD(Racer, vr_spawn, bool(Racer thisveh))
+               METHOD(Racer, vr_spawn, void(Racer thisveh))
                {
                #ifdef SVQC
                        if(self.scale != 0.5)
@@ -619,10 +616,9 @@ void racer_draw()
                        self.vehicle_health = autocvar_g_vehicle_racer_health;
                        self.vehicle_shield = autocvar_g_vehicle_racer_shield;
                #endif
-                       return true;
                }
 
-               METHOD(Racer, vr_death, bool(Racer thisveh))
+               METHOD(Racer, vr_death, void(Racer thisveh))
                {
                #ifdef SVQC
                        self.SendEntity         = func_null; // stop networking this racer (for now)
@@ -651,20 +647,18 @@ void racer_draw()
                        self.think = racer_blowup_think;
                        self.nextthink = time;
                #endif
-                       return true;
                }
 
 #ifdef CSQC
-               METHOD(Racer, vr_hud, bool(Racer thisveh))
+               METHOD(Racer, vr_hud, void(Racer thisveh))
                {
                        Vehicles_drawHUD(VEH_RACER.m_icon, "vehicle_racer_weapon1", "vehicle_racer_weapon2",
                                                         "vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
                                                         "vehicle_icon_ammo2", autocvar_hud_progressbar_vehicles_ammo2_color,
                                                         vCROSS_GUIDE);
-                       return true;
                }
 #endif
-               METHOD(Racer, vr_setup, bool(Racer thisveh))
+               METHOD(Racer, vr_setup, void(Racer thisveh))
                {
                #ifdef SVQC
                        self.vehicle_exit = racer_exit;
@@ -694,12 +688,6 @@ void racer_draw()
                #ifdef CSQC
                        AuxiliaryXhair[0].axh_image = vCROSS_LOCK; // Rocket
                #endif
-                       return true;
                }
 
-               METHOD(Racer, vr_precache, bool(Racer thisveh))
-               {
-                       return true;
-               }
-
-#endif // REGISTER_VEHICLE
+#endif
index 6d06cbc382c2ff62698a0fe31f541587bb70912c..9387a7d48513075f88af2d4166fcbb8011f0be7a 100644 (file)
@@ -613,14 +613,12 @@ void spawnfunc_vehicle_raptor()
        if(!vehicle_initialize(VEH_RAPTOR, false)) { remove(self); return; }
 }
 
-               METHOD(Raptor, vr_impact, bool(Raptor thisveh))
+               METHOD(Raptor, vr_impact, void(Raptor thisveh))
                {
                        if(autocvar_g_vehicle_raptor_bouncepain)
                                vehicles_impact(autocvar_g_vehicle_raptor_bouncepain_x, autocvar_g_vehicle_raptor_bouncepain_y, autocvar_g_vehicle_raptor_bouncepain_z);
-
-                       return true;
                }
-               METHOD(Raptor, vr_enter, bool(Raptor thisveh))
+               METHOD(Raptor, vr_enter, void(Raptor thisveh))
                {
                        self.vehicle_weapon2mode = RSM_BOMB;
                        self.owner.PlayerPhysplug = raptor_takeoff;
@@ -638,13 +636,8 @@ void spawnfunc_vehicle_raptor()
                           setorigin(self.owner.flagcarried, '-20 0 96');
 
                        CSQCVehicleSetup(self.owner, 0);
-                       return true;
-               }
-               METHOD(Raptor, vr_think, bool(Raptor thisveh))
-               {
-                       return true;
                }
-               METHOD(Raptor, vr_death, bool(Raptor thisveh))
+               METHOD(Raptor, vr_death, void(Raptor thisveh))
                {
                        self.health                             = 0;
                        self.event_damage               = func_null;
@@ -665,9 +658,8 @@ void spawnfunc_vehicle_raptor()
 
                        self.colormod = '-0.5 -0.5 -0.5';
                        self.touch = raptor_blowup;
-                       return true;
                }
-               METHOD(Raptor, vr_spawn, bool(Raptor thisveh))
+               METHOD(Raptor, vr_spawn, void(Raptor thisveh))
                {
                        if(!self.gun1)
                        {
@@ -757,9 +749,8 @@ void spawnfunc_vehicle_raptor()
                        self.damageforcescale = 0.25;
                        self.vehicle_health = autocvar_g_vehicle_raptor_health;
                        self.vehicle_shield = autocvar_g_vehicle_raptor_shield;
-                       return true;
                }
-               METHOD(Raptor, vr_setup, bool(Raptor thisveh))
+               METHOD(Raptor, vr_setup, void(Raptor thisveh))
                {
                        if(autocvar_g_vehicle_raptor_shield)
                                self.vehicle_flags |= VHF_HASSHIELD;
@@ -778,18 +769,12 @@ void spawnfunc_vehicle_raptor()
                        self.vehicle_health = autocvar_g_vehicle_raptor_health;
                        self.vehicle_shield = autocvar_g_vehicle_raptor_shield;
                        self.max_health = self.vehicle_health;
-
-                       return true;
-               }
-               METHOD(Raptor, vr_precache, bool(Raptor thisveh))
-               {
-                       return true;
                }
 
-#endif // SVQC
+#endif
 #ifdef CSQC
 
-               METHOD(Raptor, vr_hud, bool(Raptor thisveh))
+               METHOD(Raptor, vr_hud, void(Raptor thisveh))
                {
                        string crosshair;
 
@@ -804,17 +789,11 @@ void spawnfunc_vehicle_raptor()
                                                         "vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
                                                         "vehicle_icon_ammo2", autocvar_hud_progressbar_vehicles_ammo2_color,
                                                         crosshair);
-                       return true;
                }
-               METHOD(Raptor, vr_setup, bool(Raptor thisveh))
+               METHOD(Raptor, vr_setup, void(Raptor thisveh))
                {
                        AuxiliaryXhair[1].axh_image = vCROSS_LOCK;
-                       return true;
-               }
-               METHOD(Raptor, vr_precache, bool(Raptor thisveh))
-               {
-                       return true;
                }
 
-#endif // CSQC
-#endif // REGISTER_VEHICLE
+#endif
+#endif
index 11e12c4feb4e20c191077a1f2a0080fcfa846f1c..8a15d0a114ba14987ba366872fc21b636bcf45ab 100644 (file)
@@ -552,14 +552,12 @@ void spawnfunc_vehicle_spiderbot()
        if(!vehicle_initialize(VEH_SPIDERBOT, false)) { remove(self); return; }
 }
 
-               METHOD(Spiderbot, vr_impact, bool(Spiderbot thisveh))
+               METHOD(Spiderbot, vr_impact, void(Spiderbot thisveh))
                {
                        if(autocvar_g_vehicle_spiderbot_bouncepain)
                                vehicles_impact(autocvar_g_vehicle_spiderbot_bouncepain_x, autocvar_g_vehicle_spiderbot_bouncepain_y, autocvar_g_vehicle_spiderbot_bouncepain_z);
-
-                       return true;
                }
-               METHOD(Spiderbot, vr_enter, bool(Spiderbot thisveh))
+               METHOD(Spiderbot, vr_enter, void(Spiderbot thisveh))
                {
                        self.vehicle_weapon2mode = SBRM_GUIDE;
                        self.movetype = MOVETYPE_WALK;
@@ -572,17 +570,13 @@ void spawnfunc_vehicle_spiderbot()
                                setattachment(self.owner.flagcarried, self.tur_head, "");
                                setorigin(self.owner.flagcarried, '-20 0 120');
                        }
-
-                       return true;
                }
-               METHOD(Spiderbot, vr_think, bool(Spiderbot thisveh))
+               METHOD(Spiderbot, vr_think, void(Spiderbot thisveh))
                {
                        if(self.flags & FL_ONGROUND)
                                movelib_beak_simple(autocvar_g_vehicle_spiderbot_speed_stop);
-
-                       return true;
                }
-               METHOD(Spiderbot, vr_death, bool(Spiderbot thisveh))
+               METHOD(Spiderbot, vr_death, void(Spiderbot thisveh))
                {
                        self.health                             = 0;
                        self.event_damage               = func_null;
@@ -599,10 +593,8 @@ void spawnfunc_vehicle_spiderbot()
                        self.movetype                   = MOVETYPE_TOSS;
 
                        CSQCModel_UnlinkEntity(); // networking the death scene would be a nightmare
-
-                       return true;
                }
-               METHOD(Spiderbot, vr_spawn, bool(Spiderbot thisveh))
+               METHOD(Spiderbot, vr_spawn, void(Spiderbot thisveh))
                {
                        if(!self.gun1)
                        {
@@ -632,10 +624,8 @@ void spawnfunc_vehicle_spiderbot()
                        self.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
 
                        self.PlayerPhysplug = spiderbot_frame;
-
-                       return true;
                }
-               METHOD(Spiderbot, vr_setup, bool(Spiderbot thisveh))
+               METHOD(Spiderbot, vr_setup, void(Spiderbot thisveh))
                {
                        if(autocvar_g_vehicle_spiderbot_shield)
                                self.vehicle_flags |= VHF_HASSHIELD;
@@ -651,12 +641,6 @@ void spawnfunc_vehicle_spiderbot()
                        self.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
                        self.max_health = self.vehicle_health;
                        self.pushable = true; // spiderbot can use jumppads
-
-                       return true;
-               }
-               METHOD(Spiderbot, vr_precache, bool(Spiderbot thisveh))
-               {
-                       return true;
                }
 
 #endif // SVQC
@@ -664,7 +648,7 @@ void spawnfunc_vehicle_spiderbot()
 float autocvar_cl_vehicle_spiderbot_cross_alpha = 0.6;
 float autocvar_cl_vehicle_spiderbot_cross_size = 1;
 
-               METHOD(Spiderbot, vr_hud, bool(Spiderbot thisveh))
+               METHOD(Spiderbot, vr_hud, void(Spiderbot thisveh))
                {
                        string crosshair;
 
@@ -680,19 +664,12 @@ float autocvar_cl_vehicle_spiderbot_cross_size = 1;
                                                         "vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
                                                         "vehicle_icon_ammo2", autocvar_hud_progressbar_vehicles_ammo2_color,
                                                         crosshair);
-                       return true;
                }
-               METHOD(Spiderbot, vr_setup, bool(Spiderbot thisveh))
+               METHOD(Spiderbot, vr_setup, void(Spiderbot thisveh))
                {
                        AuxiliaryXhair[0].axh_image = vCROSS_HINT; // Minigun1
                        AuxiliaryXhair[1].axh_image = vCROSS_HINT; // Minigun2
-
-                       return true;
-               }
-               METHOD(Spiderbot, vr_precache, bool(Spiderbot thisveh))
-               {
-                       return true;
                }
 
-#endif // CSQC
-#endif // REGISTER_VEHICLE
+#endif
+#endif