More tests

This commit is contained in:
ineedbots 2021-05-12 14:33:23 -06:00
parent f836f7529a
commit d4a617a630
4 changed files with 32 additions and 14 deletions

View File

@ -417,6 +417,7 @@ added()
*/ */
add_bot() add_bot()
{ {
//bot = addTestClient();
setDvar("addBots", 1); setDvar("addBots", 1);
wait 0.05; wait 0.05;
@ -766,7 +767,7 @@ addBots()
{ {
tempBot = random(getBotArray()); tempBot = random(getBotArray());
if (isDefined(tempBot)) if (isDefined(tempBot))
setDvar("removeBot", tempBot getEntityNumber()); kick(tempBot getEntityNumber());
} }
} }
} }

View File

@ -1408,7 +1408,7 @@ onGiveLoadout()
if (isDefined(self.bot_oma_class)) if (isDefined(self.bot_oma_class))
class = self.bot_oma_class; class = self.bot_oma_class;
//self botGiveLoadout(self.team, class, !isDefined(self.bot_oma_class)); self botGiveLoadout(self.team, class, !isDefined(self.bot_oma_class));
self.bot_oma_class = undefined; self.bot_oma_class = undefined;
} }
} }

View File

@ -1710,3 +1710,7 @@ random_normal_distribution( mean, std_deviation, lower_bound, upper_bound )
onUsePlantObjectFix( player ) onUsePlantObjectFix( player )
{ {
} }
botGiveLoadout(team, class, copycat)
{
}

View File

@ -12,6 +12,8 @@
init() init()
{ {
thread test();
if(getDvar("bots_main_debug") == "") if(getDvar("bots_main_debug") == "")
setDvar("bots_main_debug", 0); setDvar("bots_main_debug", 0);
@ -57,8 +59,6 @@ init()
level.waypoints = []; level.waypoints = [];
level.waypointCount = 0; level.waypointCount = 0;
test();
level waittill( "connected", player); level waittill( "connected", player);
player thread onPlayerSpawned(); player thread onPlayerSpawned();
@ -76,12 +76,14 @@ onPlayerSpawned()
test() test()
{ {
wait 0.5;
// regression // regression
a = 801; a = 801;
if (a <= -800) if (a <= -800)
a = 800; a = 800;
logstring(a); // 801 print(a); // 801
// regression // regression
dir = "yo"; dir = "yo";
@ -96,8 +98,8 @@ test()
b = 2; b = 2;
logstring(dir); // yo print(dir); // yo
logstring(r); // 3 print(r); // 3
@ -107,7 +109,7 @@ test()
f = ::test_func; f = ::test_func;
[[f]](e, 4); // test_func 4 4 [[f]](e, 4); // test_func 4 4
logstring(e.a); // 5 print(e.a); // 5
test_func2(::test_func3, "hi"); // hi test_func2(::test_func3, "hi"); // hi
@ -124,10 +126,10 @@ test()
switch ("kek") switch ("kek")
{ {
case "lol": case "lol":
logstring("FUCKKKKKKKK"); // 1 1 print("FUCKKKKKKKK");
break; break;
case "kek": case "kek":
logstring("HAHAHAHAHAAH"); // 1 1 print("HAHAHAHAHAAH");
break; break;
} }
@ -147,7 +149,7 @@ test()
break; break;
} }
logstring(isDefined(callbacksort) + " " + y); // 1 1 print(isDefined(callbacksort) + " " + y); // 1 1
// test heap sorting // test heap sorting
@ -168,12 +170,23 @@ test()
sort HeapRemove(); sort HeapRemove();
} }
logstring(str); // -123, 0, 1, 3, 3, 4, 87, print(str); // -123, 0, 1, 3, 3, 4, 87,
thread await();
level waittill("aaaa", aa, bb, cc, dd);
print(aa + " " + bb + " " + cc + " " + dd); // 1 2 3 4
}
await()
{
wait 0.5;
level notify("aaaa", 1, 2, 3, "4");
} }
test_func(a, b) test_func(a, b)
{ {
logstring("test_func " + b + " " + a.a); print("test_func " + b + " " + a.a);
a.a += 1; a.a += 1;
} }
@ -184,7 +197,7 @@ test_func2(a, b)
test_func3(a) test_func3(a)
{ {
logstring(a); print(a);
} }
StartDev() StartDev()