1
0
mirror of https://github.com/ineedbots/iw5_bot_warfare.git synced 2026-03-26 20:23:03 +00:00

Fix up child vars

This commit is contained in:
ineedbots
2021-05-24 20:48:16 -06:00
parent d78a9c4afd
commit 091527e6a6
2 changed files with 260 additions and 38 deletions

View File

@@ -15,7 +15,7 @@
*/
init()
{
level.bw_VERSION = "1.0.0";
level.bw_VERSION = "2.0.1";
if(getDvar("bots_main") == "")
setDvar("bots_main", true);
@@ -161,6 +161,7 @@ init()
level thread addNotifyOnAirdrops();
level thread watchScrabler();
level thread watchRadar();
level thread auditModels();
level thread handleBots();
@@ -310,6 +311,40 @@ fixKoth()
}
}
/*
Audits all the important models cause iw5 script is kek
*/
auditModels()
{
level.vest_boxes = [];
for (;;)
{
wait 0.05;
level.vest_boxes = array_removeUndefined(level.vest_boxes);
s_models = getEntArray("script_model", "classname");
for (i = s_models.size - 1; i >= 0; i--)
{
model = s_models[i];
if (!isDefined(model))
continue;
if (isDefined(model.bot_audit_model))
continue;
if (model.model == "com_deploy_ballistic_vest_friend_world")
{
model.bot_audit_model = true;
level.vest_boxes[level.vest_boxes.size] = model;
}
}
}
}
/*
Watches radars
*/