]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bumblebee spawn test
authorTimePath <andrew.hardaker1995@gmail.com>
Thu, 24 Mar 2016 01:04:38 +0000 (12:04 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Thu, 24 Mar 2016 01:05:29 +0000 (12:05 +1100)
qcsrc/server/tests.qc
qcsrc/server/tests.qh

index 0b153fff1e4cc3f472089f90fcbf15b0529e0921..be5d3773c0a1bfc92fefded156fe985ec669f83f 100644 (file)
@@ -11,12 +11,12 @@ TEST(Weapons, Hurt)
 {
     entity it;
 
-    Client a = it = NEW(Client, "A");
+    noref Client a = it = NEW(Client, "A");
     WITH(float, autocvar_g_spawnshieldtime, 0, Client_Add(it, NUM_TEAM_1));
     it.origin = '-100 0 0';
     it.angles = '0 0 0';
 
-    Client b = it = NEW(Client, "B");
+    noref Client b = it = NEW(Client, "B");
     WITH(float, autocvar_g_spawnshieldtime, 0, Client_Add(it, NUM_TEAM_2));
     it.origin = '100 0 0';
     it.angles = '0 180 0';
@@ -36,3 +36,19 @@ TEST(Weapons, Hurt)
 
     SUCCEED();
 }
+
+TEST(Vehicles, Spawn)
+{
+    entity it;
+
+    noref Client bot = it = NEW(Client, "Rider");
+    Client_Add(it, NUM_TEAM_1);
+    it.origin = '0 0 100';
+
+    noref entity v = it = new(vehicle);
+    Vehicle veh = VEH_BUMBLEBEE;
+    it.active = ACTIVE_NOT;
+    WITH(entity, self, it, vehicle_initialize(veh, false); it.nextthink = time);
+
+    SUCCEED();
+}
index 05c8d371fb41342a10269f844158c2f222dee6fe..be6445b48e4c696ca82ffef01dd7207807229754 100644 (file)
@@ -8,3 +8,4 @@
 #include <common/items/item.qh>
 #include <common/physics/player.qh>
 #include <common/weapons/all.qh>
+#include <common/vehicles/all.qh>