]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a vehicle hook when setting colors, so vehicles with modules that aren't directly...
authorMario <mario@smbclan.net>
Sat, 17 Jun 2017 23:03:55 +0000 (09:03 +1000)
committerMario <mario@smbclan.net>
Sat, 17 Jun 2017 23:03:55 +0000 (09:03 +1000)
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/vehicle.qh

index 659b3c148d005c6a1a618772361020779519ecbb..1848b63b7a0692ebbe01e323c3a50c2d044f6a02 100644 (file)
@@ -449,6 +449,9 @@ void vehicles_reset_colors(entity this)
        this.avelocity = '0 0 0';
        this.velocity  = '0 0 0';
        this.effects   = eff;
+
+       Vehicle info = Vehicles_from(this.vehicleid);
+       info.vr_setcolors(info, this);
 }
 
 void vehicles_clearreturn(entity veh)
index 4e3b7b8729f374a104a449cd9ac0943ae40de8b6..5b30b845e1a8d67b18d08fddc4970900e01c276c 100644 (file)
@@ -51,6 +51,8 @@ CLASS(Vehicle, Object)
     METHOD(Vehicle, vr_spawn, void(Vehicle this, entity instance)) { }
     /** (SERVER) called when a vehicle hits something */
     METHOD(Vehicle, vr_impact, void(Vehicle this, entity instance)) { }
+    /** (SERVER) called when a vehicle's colors are being reset, so modules can be updated */
+    METHOD(Vehicle, vr_setcolors, void(Vehicle this, entity instance)) { }
     /** (CLIENT) logic to run every frame */
     METHOD(Vehicle, vr_hud, void(Vehicle this)) { }
     /** (CLIENT) logic to run every frame */