mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-21 21:45:43 +00:00
Fix possible script errors
This commit is contained in:
parent
89bb00de88
commit
779a83a83a
@ -2870,6 +2870,9 @@ bot_equipment_kill_think()
|
|||||||
{
|
{
|
||||||
item = grenades[i];
|
item = grenades[i];
|
||||||
|
|
||||||
|
if (!isDefined(item))
|
||||||
|
continue;
|
||||||
|
|
||||||
if ( !IsDefined( item.name ) )
|
if ( !IsDefined( item.name ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -2945,7 +2948,7 @@ bot_equipment_kill_think()
|
|||||||
if (path != "new_goal")
|
if (path != "new_goal")
|
||||||
self ClearScriptGoal();
|
self ClearScriptGoal();
|
||||||
|
|
||||||
if (path != "goal")
|
if (path != "goal" || !isDefined(target))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (randomInt(100) < self.pers["bots"]["behavior"]["camp"] * 8)
|
if (randomInt(100) < self.pers["bots"]["behavior"]["camp"] * 8)
|
||||||
@ -3279,6 +3282,9 @@ bot_turret_think()
|
|||||||
{
|
{
|
||||||
tempTurret = turrets[turretsKeys[i]];
|
tempTurret = turrets[turretsKeys[i]];
|
||||||
|
|
||||||
|
if (!isDefined(tempTurret))
|
||||||
|
continue;
|
||||||
|
|
||||||
if(tempTurret.health <= 20000)
|
if(tempTurret.health <= 20000)
|
||||||
continue;
|
continue;
|
||||||
if (isDefined(tempTurret.carriedBy))
|
if (isDefined(tempTurret.carriedBy))
|
||||||
@ -3365,6 +3371,9 @@ bot_watch_stuck_on_crate()
|
|||||||
{
|
{
|
||||||
tempCrate = crates[i];
|
tempCrate = crates[i];
|
||||||
|
|
||||||
|
if (!isDefined(tempCrate))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (!isDefined(tempCrate.doingPhysics) || tempCrate.doingPhysics)
|
if (!isDefined(tempCrate.doingPhysics) || tempCrate.doingPhysics)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -3437,6 +3446,9 @@ bot_crate_think()
|
|||||||
{
|
{
|
||||||
tempCrate = crates[i];
|
tempCrate = crates[i];
|
||||||
|
|
||||||
|
if (!isDefined(tempCrate))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (!isDefined(tempCrate.doingPhysics) || tempCrate.doingPhysics)
|
if (!isDefined(tempCrate.doingPhysics) || tempCrate.doingPhysics)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -3480,7 +3492,7 @@ bot_crate_think()
|
|||||||
if (path != "new_goal")
|
if (path != "new_goal")
|
||||||
self ClearScriptGoal();
|
self ClearScriptGoal();
|
||||||
|
|
||||||
if (path != "goal" || DistanceSquared(self.origin, crate.origin) > radius*radius)
|
if (path != "goal" || !isDefined(crate) || DistanceSquared(self.origin, crate.origin) > radius*radius)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3488,7 +3500,7 @@ bot_crate_think()
|
|||||||
self BotFreezeControls(true);
|
self BotFreezeControls(true);
|
||||||
|
|
||||||
waitTime = 3;
|
waitTime = 3;
|
||||||
if (crate.owner == self)
|
if (isDefined(crate.owner) && crate.owner == self)
|
||||||
waitTime = 0.5;
|
waitTime = 0.5;
|
||||||
|
|
||||||
crate waittill_notify_or_timeout("captured", waitTime);
|
crate waittill_notify_or_timeout("captured", waitTime);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user