]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/tests.qc
Properly support team field on trigger_multiple
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / tests.qc
index 0b153fff1e4cc3f472089f90fcbf15b0529e0921..50dc5a35bca7cd130b7732fe141819539bc64e01 100644 (file)
@@ -1,22 +1,22 @@
 #include "tests.qh"
 
-void test_weapons_hurt() {
-    SELFPARAM();
+void test_weapons_hurt(entity this)
+{
     EXPECT_NE(100, this.health);
-    remove(this.enemy);
-    remove(this);
+    delete(this.enemy);
+    delete(this);
 }
 
 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';
@@ -26,7 +26,7 @@ TEST(Weapons, Hurt)
     it.items |= IT_UNLIMITED_AMMO;
     Weapon wep = WEP_VORTEX;
     W_GiveWeapon(it, wep.m_id);
-    W_SwitchWeapon_Force(it, wep);
+    W_SwitchWeapon_Force(it, wep, weaponentities[0]);
 
     it = b;
     PHYS_INPUT_BUTTON_JUMP(it) = true;
@@ -36,3 +36,20 @@ 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;
+    vehicle_initialize(it, veh, false);
+    it.nextthink = time;
+
+    SUCCEED();
+}