]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a hack to give and take buff time when entering/leaving vehicle
authorMario <mario@smbclan.net>
Mon, 2 Nov 2015 01:46:36 +0000 (11:46 +1000)
committerMario <mario@smbclan.net>
Mon, 2 Nov 2015 01:46:36 +0000 (11:46 +1000)
qcsrc/server/mutators/mutator/mutator_buffs.qc

index 4f0758fa3535ff86743332ced0aa2e2ae3b6608a..6aacfedb4d2aae4a4870b0ae3bdf240f59096e3e 100644 (file)
@@ -939,6 +939,8 @@ MUTATOR_HOOKFUNCTION(buffs, VehicleEnter)
 {
        vh_vehicle.buffs = vh_player.buffs;
        vh_player.buffs = 0;
+       vh_vehicle.buff_time = vh_player.buff_time - time;
+       vh_player.buff_time = 0;
        return false;
 }
 
@@ -946,6 +948,8 @@ MUTATOR_HOOKFUNCTION(buffs, VehicleExit)
 {
        vh_player.buffs = vh_vehicle.buffs;
        vh_vehicle.buffs = 0;
+       vh_player.buff_time = time + vh_vehicle.buff_time;
+       vh_vehicle.buff_time = 0;
        return false;
 }